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: Drop table in sql

Re: Drop table in sql

From: flux <flux_at_berlin.snafu.de>
Date: 1997/09/19
Message-ID: <3422842F.582D1095@berlin.snafu.de>#1/1

Andreas Hess wrote:
>
> Hi
>
> Connected as the table owner, run the following from SQL*Plus:
>
> SPOOL drop.sql
>
> SELECT 'DROP TABLE ' || TABLE_NAME || ';'
> FROM USER_TABLES;
>
> SPOOL OFF
>
> Remove the odd header line from the generated script
> and run using @drop.sql from SQL*Plus.
>
> You may have to run this script several times if you have
> foreign key constraints on some tables...
>
> Hope this helps
>
> Andreas
>
> Cuong Quyen Truong <jackt_at_cse.unsw.EDU.AU> wrote in article
> <Pine.OSF.3.95.970918192949.21195D-100000_at_pipe07.orchestra.cse.unsw.EDU.AU>.
> .
> >
> > Does anyone know how to drop all the tables with one sql sttement.
> >
> >

Select 'drop table' || table_name || 'cascade constraints;' from user_tables;
works better.

  Daniel Received on Fri Sep 19 1997 - 00:00:00 CDT

Original text of this message

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