Home > Archive > Oracle Database discussion > January 2006 > Remove all tables for user with one SQl statement?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Remove all tables for user with one SQl statement?
Jan Doggen

2005-12-16, 11:23 am

Hi

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

with one SQL statement?

Thanks in advance
Jan


HansF

2005-12-16, 8:23 pm

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

2) Is dropping the user at the same time allowed?
Chuck

2006-01-09, 11:23 am

"Jan Doggen" <j.doggen@BLOCKqsa.nl> wrote in news:43a2ee48$0$1106
2
$e4fe514c@news.xs4all.nl:

> 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.
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com