Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: dropping a large number of tables?

Re: dropping a large number of tables?

From: Connor McDonald <mcdonald.connor.cs_at_bhp.com.au>
Date: 1998/10/21
Message-ID: <362D9A85.40D5@bhp.com.au>#1/1

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 Dali
Received on Wed Oct 21 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US