Oracle/Drop all user tables

From YavInWiki
Revision as of 08:49, 31 August 2010 by Andy (talk | contribs) (New page: <source lang="oracle11"> select 'drop table '||table_name||' cascade constraints;' from user_tables; BEGIN for c in (select table_name from user_tables) loop execute immediate ('drop ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
select 'drop table '||table_name||' cascade constraints;' from user_tables;

BEGIN
  for c in (select table_name from user_tables) loop
  execute immediate ('drop table '||c.table_name||' cascade constraints');
  end loop;
END;