DECLARE
BEGIN

FOR eachObject IN
( SELECT 'DROP ' || object_type || ' ' || object_name || DECODE ( object_type, 'TABLE', ' CASCADE CONSTRAINTS PURGE' ) AS statement_sql
FROM user_objects
WHERE object_type IN ( 'TABLE', 'VIEW', 'PACKAGE', 'TYPE', 'PROCEDURE', 'FUNCTION', 'TRIGGER', 'SEQUENCE' )
ORDER BY object_type,
object_name )
LOOP
EXECUTE IMMEDIATE eachObject.statement_sql;
END LOOP;
END;
/

 

en_USEnglish