Drop all tables in Oracle


/ Published in: PL/SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.