Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: dropping a large number of tables?
Try this:
DECLARE
cursor_name INTEGER;
run_job INTEGER;
BEGIN cursor_name := DBMS_SQL.OPEN_CURSOR;
FOR i IN (SELECT table_name
FROM user_tables WHERE table_name LIKE 'mytable_%') LOOP DBMS_SQL.PARSE (cursor_name, 'DROP TABLE '||i.table_name, DBMS_SQL.V7);
run_job := DBMS_SQL.EXECUTE (cursor_name);
END LOOP; DBMS_SQL.CLOSE_CURSOR (cursor_name);
END;
/
Much neater
Regards
Nick Butcher Received on Wed Oct 28 1998 - 00:00:00 CST