Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> drop table script
I am trying to write a drop table, view .. script, which will find all
my user objects and drops them. But apparently PL/SQL does not support
drops or creates, which is really weird. Following is the script that I
have written. Can someone suggest some modifications or a way to achieve
my goal? I have even tried putting the drop statement within single
quotes and also within double quotes.
Thanks in advance.
P.S. - PLEASE MAKE SURE YOU HAVE A DUMMY USER/ DATABASE BEFORE USING THIS SCRIPT. IF IT DOES WORK, IT WILL DROP ALL THE OBJECTS IN YOUR USER ACCOUNT. --Sonali.
SCRIPT:
DECLARE
CURSOR cur_obj IS
SELECT object_name, object_type FROM user_objects;
BEGIN
FOR cur_rec IN cur_obj LOOP
drop cur_rec.object_type cur_rec.object_name;
END LOOP;
COMMIT;
END;
/
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Nov 19 1999 - 13:39:35 CST