Is it possible to drop more than one table using single sql statement? if yes then how.

Questions by ambrish20

Showing Answers 1 - 15 of 15 Answers

subash

  • Apr 22nd, 2007
 

No, because we can drop only one table or table data by using drop.

  Was this answer useful?  Yes

abhishek reddy

  • May 6th, 2007
 

Yes we can drop more than 1 table  using  spool.


Dropping all tables from a user:----

sql> select 'drop table' || 'tname' || from tab;

sql> spool pp;

//copy all the data  from all the tables//

sql>spool off;

sql> @pp.lst

  Was this answer useful?  Yes

senthilora

  • Sep 24th, 2007
 

That is not correct Abhishek reddy..:)

Spool is not a SQL statement.  Moreover, actually you are creating multiple SQL statements and executing them.

No - would be my answer if the question was "is that possible to drop more than one table by using single DROP TABLE statement"

Yes - is my answer as "DROP USER .. CASCADE" statement will drop all the tables at once owned by a specific user. 

skranof

  • Jul 2nd, 2009
 

I assume you already figured this out, but if not

simply

use dbName
go

drop table table1, table2, table3

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions