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: How to drop table with like

Re: How to drop table with like

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 29 May 2002 07:16:27 GMT
Message-ID: <Xns921D5E7515B76gnuegischgnueg@130.133.1.4>


> Hello Experts!!
>
> Is it possible to drop all table that match this string '%KJL_%' by using
> any sort of sql.

something like

begin
  for tn in (select table_name t from user_tables

               where table_name like '%KJL_%') loop     execute immediate 'drop table ' || tn.t;   end loop;
end;
/

should do the job.

Variations: use dba_tables or all_tables instead of user_tables in get informed what the difference between these is.

hth

Rene

-- 
Recherchen im schweizerischen Handelsregister: 
http://www.adp-gmbh.ch/SwissCompanies/Search.php3
Received on Wed May 29 2002 - 02:16:27 CDT

Original text of this message

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