Connecting Tech Pros Worldwide Help | Site Map

Remove all tables for user with one SQl statement?

  #1  
Old June 27th, 2008, 08:03 PM
Jan Doggen
Guest
 
Posts: n/a
Hi

How can I remove all tables
UserName.TblNam1
UserName.TblNam2
UserName.TblNam3
etc

with one SQL statement?

Thanks in advance
Jan


  #2  
Old June 27th, 2008, 08:03 PM
HansF
Guest
 
Posts: n/a

re: Remove all tables for user with one SQl statement?


1) Newsgroup is obsolete - please use comp.databases.oracle.server'

2) Is dropping the user at the same time allowed?
  #3  
Old June 27th, 2008, 08:03 PM
Chuck
Guest
 
Posts: n/a

re: Remove all tables for user with one SQl statement?


"Jan Doggen" <j.doggen@BLOCKqsa.nlwrote in news:43a2ee48$0$11062
$e4fe514c@news.xs4all.nl:
Quote:
Hi
>
How can I remove all tables
UserName.TblNam1
UserName.TblNam2
UserName.TblNam3
etc
>
with one SQL statement?
>
Thanks in advance
Jan
>
>

An anonymous PL/SQL block...


begin
executute immediate 'drop table UserName.TblNam1';
executute immediate 'drop table UserName.TblNam2';
executute immediate 'drop table UserName.TblNam3';
end;
/

Or you could write a "dropalltables" stored procedure and run that.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help writing SQL statement in PHP script Chuck Cheeze answers 118 June 27th, 2008 05:15 PM
Download the JAVA , .NET and SQL Server interview with answers Jobs answers 2 September 26th, 2006 02:25 PM
Download the JAVA , .NET and SQL Server interview PDF Jobs answers 0 September 17th, 2006 02:05 PM
Remove all tables for user with one SQl statement? Jan Doggen answers 2 January 9th, 2006 04:15 PM