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 -> drop table script

drop table script

From: <sonali2000_at_my-deja.com>
Date: Fri, 19 Nov 1999 19:39:35 GMT
Message-ID: <81491m$57j$1@nnrp1.deja.com>


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

Original text of this message

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