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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Re: sql script delete all tables

Re: Re: sql script delete all tables

From: Alan <alan_at_erols.com>
Date: Fri, 21 Mar 2003 12:45:42 -0500
Message-ID: <b5fj46$28mlbn$1@ID-114862.news.dfncis.de>


I made a mistake in the code (I hate paying syntax), so perhaps that is the source of the confusion. This should do it:

SELECT 'drop table '||tname||';' from tab;

SQL> / 'DROPTABLE'||TNAME||';'



drop table AGENTCLIENT;
drop table AGENTDIVISION;
drop table APPLICANT;
drop table APPLICANT_AUDIT;

Just log in as the schema owner and run the code as provided. The code will generate a DROP statement for each table as above. All you need to do then is copy and paste the whole block of statements.

"teen" <s4012051_at_student.uq.edu.au> wrote in message news:b5dsrg$pt0$1_at_bunyip.cc.uq.edu.au...
>
> >OR,
> >
> >SELECT 'drop table '||tname||' from tab ; ' ;
>
> Am I meant to replace ||tname|| with the table name? Or is that some kind
of
> command?
>
> >
> >Then copy and paste...
>
> Ahh yes, that will kind of defeat the purpose of making a script :/
>
> >
>
> I was thinking along the lines of something like
> DROP TABLE * WHERE TABLE_NAME IN (SELECT TABLE_NAME FROM USER_TABLES);
>
> obviously i'm unsure if the syntax is correct.. i'm soon installing oracle
on
> this system so i'll be able to play around a bit.
>
> thanks for any hints I can get :P
>
>
Received on Fri Mar 21 2003 - 11:45:42 CST

Original text of this message

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