Home » SQL & PL/SQL » SQL & PL/SQL » droping table(s)
droping table(s) [message #6486] Mon, 21 April 2003 08:12 Go to next message
sriki
Messages: 1
Registered: April 2003
Junior Member
how to drop all the table(s) in the database at the sametime.
One Quick way ... [message #6505 is a reply to message #6486] Tue, 22 April 2003 12:15 Go to previous messageGo to next message
Thomas G
Messages: 58
Registered: April 2003
Member
... If they all belong to one user, and there are no triggers or packages or stuff ...

drop user xxxxx cascade;

create user xxxxx identified by yyyyy;


Be shure to also set the default tablespace and everything else you need, when you re-create the user.
Re: One Quick way ... [message #6512 is a reply to message #6486] Tue, 22 April 2003 18:48 Go to previous messageGo to next message
Rajiv
Messages: 14
Registered: April 2001
Junior Member
just write a script in which you can select all the tables from user_tables and then drop each table inside the loop.
Re: droping table(s) [message #6522 is a reply to message #6486] Wed, 23 April 2003 03:38 Go to previous message
Jayasri
Messages: 28
Registered: July 2000
Junior Member
spool a file with all the tables as below.

SQL> SET HEADING OFF

SQL> SPOOL C:DR.TXT

SQL> SELECT 'DROP TABLE '||TABLE_NAME||';' FROM
USER_TABLES WHERE TABLE_NAME LIKE 'E%';

SQL> SPOOL OFF.

Open DR.txt
This will have the select statement also. Remove the select statement.

Run the file in SQL prompt.

SQL> @C:DR.TXT
Previous Topic: How to run SQL from an application?
Next Topic: How to execute a shell script from PL/SQL Block?
Goto Forum:
  


Current Time: Fri Apr 19 17:23:01 CDT 2024