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: SQL Script Problem

Re: SQL Script Problem

From: Kenny Gump <kgump_at_mylanlabs.com>
Date: Thu, 29 Apr 1999 07:56:48 -0400
Message-ID: <372848cb.0@news.mountain.net>


Try the following in your script:

set echo off
set verify off
set feedback off
set pagesize 0

spool drop_all.sql

select 'drop table ' || table_name || ' cascade constraints ' || chr(10) || '/'
from user_tables
/
spool off
@drop_all.sql

This will select all the tables owned by the current user and create a script to drop them and then call the script it just wrote.

Kenny Gump
OCP 7.3 DBA Matt Randle wrote in message
<925319852.9580.0.nnrp-07.d4e48d0d_at_news.demon.co.uk>...
>I have an Oracle SQL Script that we use to create all our db objects.
>
>At a number of places within the script I want it to delete all the tables,
>indexes, etc within the current schema ?
>
>Is there any way to do this in SQL without knowing beforehand what the
>tables you want to delete are ?
>
>Thanks,
>
>Matt.
>
>
Received on Thu Apr 29 1999 - 06:56:48 CDT

Original text of this message

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