Posted By

kamilch on 08/06/09


Tagged

Oracle


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

michaelss


Drop all tables in Oracle


 / Published in: PL/SQL
 

  1. -- drop all tables in current schema
  2. table_name VARCHAR2(30);
  3. CURSOR usertables IS SELECT * FROM user_tables WHERE table_name NOT LIKE 'BIN$%';
  4. FOR next_row IN usertables
  5. EXECUTE IMMEDIATE 'drop table ' || next_row.table_name || ' cascade constraints';
  6. /

Report this snippet  

You need to login to post a comment.