kumsa29

Adv Auth : DROP ALL TABLES IN A SINGLE SHOT

Blog Post created by kumsa29 Employee on Aug 3, 2018

ORACLE:: DROP ALL TABLES IN A SINGLE SHOT

If you are into software development, you may have wanted to drop all tables of an Oracle database schema in a single shot, use the following simple PL/SQL procedure.

begin
for i in (select * from tabs) loop
execute immediate ('drop table ' || i.table_name || ' cascade constraints');
end loop;
end;
/

‘tabs’ is actually an in-built view in Oracle. 

Outcomes