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 -> Re: any way drop several tables in one go?

Re: any way drop several tables in one go?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 5 Jul 1999 18:36:17 +0200
Message-ID: <931192532.22191.0.pluto.d4ee154e@news.demon.nl>


In v7 replace the direct drop by
cur_handle integer;

cur_handle := dbms_sql.open_cursor;
dbms_sql.parse(cur_handle, 'drop table '||ta, dbms_sql.native);
dbms_sql.close(cur_handle);

You get the idea hopefully.

Hth,

Sybrand Bakker, Oracle DBA

  Ruiping Gao <ruiping_at_dpiwe.tas.gov.au> wrote in message = news:378043E2.66C9D367_at_dpiwe.tas.gov.au...     

Hi,
Is there any way to delete several tables in one go? I had 200 tables created by user and need delete it in one go. What I = did is first create a table to hold all table name which I what to = delete.
Then I use PL/SQL did following:
DECLARE
ta table_delete.table_name%type;
cursor a is select table_name from table_delete; BEGIN

        open a;
        fetch a into ta;
        while a%found loop
            drop table ta;
        fetch a into ta;
        end loop;
        close a;

END;
I got following error message
RROR at line 8:
ORA-06550: line 8, column 3:
PLS-00103: Encountered the symbol "DROP" when expecting one of the =
following:

begin declare exit for goto if loop mod null pragma raise return select update while <an identifier> <a double-quoted delimited-identifier> etc.

Thanks in advance,
ruiping
e_mail:ruiping_at_dpiwe.tas.gov.au      Received on Mon Jul 05 1999 - 11:36:17 CDT

Original text of this message

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