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 ALL Tables!!How??

Re: Drop ALL Tables!!How??

From: Mike Cahall <mcahall_at_clark.net>
Date: Mon, 28 Sep 1998 12:12:33 -0500
Message-ID: <6uoc8m$cgc$1@clarknet.clark.net>


You can't issue a DDL command from inside PL/SQL. I think there is now a package that will let you execute some DDL commands, but the old-fashioned way would be to create a .sql file and execute it as follows: spool filename
select 'drop table '||tablename||';' from user_tables; spool off

@filename

Cincout wrote in message <360FA330.8F7CFB6A_at_hongkong.com>...
>I am new to PL/SQL, I have tried to write a script to drop all tables as
>follow but enter a runtime error.
>What wrong is It?
>Thanks a lot!!
>
>Begin
>for curTable in (select table_name from user_tables) loop
> DROP TABLE CURTABLE.TABLE_NAME;
>end loop;
>END;
Received on Mon Sep 28 1998 - 12:12:33 CDT

Original text of this message

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