Connecting Tech Pros Worldwide Forums | Help | Site Map

Remove all tables for user with one SQl statement?

Jan Doggen
Guest
 
Posts: n/a
#1: Dec 16 '05
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: Dec 16 '05

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: Jan 9 '06

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


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


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