| Sachin |
Posted: Mar 29, 2007 10:47:17 AM |
Total Post: 2
Joined: Feb, 2007
|
I want to know how to delete all the tables using a single query?
|
|
|
Jayanta |
| Posted: Mar 29, 2007 12:43:58 PM | |
|
Total Post: 479
Joined: Feb, 2006
|
|
|
|
|
Sachin |
| Posted: Mar 31, 2007 02:12:40 AM | |
|
Total Post: 2
Joined: Feb, 2007
|
yes!
u r right for deleting a single table. but my query is to delete all the tables using a single query.
|
|
|
|
|
Devesh |
| Posted: Apr 02, 2007 03:39:49 AM | |
|
Total Post: 29
Joined: Oct, 2005
|
To Drop all your tables you can use the following in a script:
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SET MARKUP HTML OFF
SET ESCAPE \
SPOOL DELETEME.SQL
select 'drop table ', table_name, 'cascade constraints \;' from user_tables;
SPOOL OFF
@DELETEME
|
|
|
|
|
bigPapas |
| Posted: Apr 03, 2007 05:59:38 PM | |
|
Total Post: 14
Joined: Apr, 2007
|
if you want to drop all tables from a particular schema, just drop and recreate the schema. All underlying objects owned by the schema will be dropped as well. If you aren't using TOAD or SQL Developer, manually gather info about the user, default table space, password, roles and privs. Then drop and recreate.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |