Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Drop ALL Tables!!How??
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