Connecting Tech Pros Worldwide Forums | Help | Site Map

Remove all tables for user with one SQl statement?

Jan Doggen
Guest
 
Posts: n/a
#1: Jun 27 '08
Hi

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

with one SQL statement?

Thanks in advance
Jan



HansF
Guest
 
Posts: n/a
#2: Jun 27 '08

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?
Chuck
Guest
 
Posts: n/a
#3: Jun 27 '08

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