Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: dropping a large number of tables?
bigdavemaw_at_my-dejanews.com wrote:
>
> I have a large number of tables that are all start with "mytable_".
> i.e. mytable_1, mytable_2, ...
>
> What would be the best way to drop all tables in my table space that start
> with mytable_ ?
>
> I know there must be a system table that lists all tables for a tablespace,
> but don't know what it is.
>
> Any ideas?
> Thanks,
> Dave
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
spool myfile.sql
select 'drop table '||table_name||' cascade constraints;'
from user_tables
where table_name like 'MYTAB%';
spool off
@myfile.sql
-- ============================================== Connor McDonald BHP Information Technology Perth, Western Australia "The difference between me and a madman is that I am not mad" - Salvador DaliReceived on Wed Oct 21 1998 - 00:00:00 CDT