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: Dick Allie <dallie_at_ionet.net>
Date: 1997/09/18
Message-ID: <34212336.102E@ionet.net>#1/1

Cuong Quyen Truong wrote:
>
> Does anyone know how to drop all the tables with one sql sttement.
Hi,
If they are all in one tablespace you can drop the tablespace including contents. The best way is to create a sql script that drops each table. Example:
set echo off head off pagesize 0 verify off feedback off spool drop_table.sql
select 'drop '||owner||'.'||object_name||';' from dba_objects
where owner in ('owner1','owner2',.....) order by 1
/
spool off
start drop_table.sql
exit
be sure NOT to include system or sys in the list of owners.

Hope this helps
Regards, Dick Received on Thu Sep 18 1997 - 00:00:00 CDT

Original text of this message

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