Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Re: sql script delete all tables
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||';'
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
![]() |
![]() |