Difference between revisions of "Oracle/Drop all user tables"
Jump to navigation
Jump to search
(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 ...) |
m |
||
| Line 4: | Line 4: | ||
BEGIN | BEGIN | ||
for c in (select table_name from user_tables) loop | for c in (select table_name from user_tables) loop | ||
execute immediate ('drop table '||c.table_name||' cascade constraints'); | |||
end loop; | end loop; | ||
END; | END; | ||
Revision as of 08:49, 31 August 2010
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;