1 BEGIN 2 FOR REC IN 3 (SELECT OBJECT_NAME,OBJECT_TYPE FROM USER_OBJECTS 4 WHERE OBJECT_TYPE='PROCEDURE' 5 OR OBJECT_TYPE='TABLE' 6 OR OBJECT_TYPE='VIEW' 7 OR OBJECT_TYPE='FUNCTION' 8 OR OBJECT_TYPE='PACKAGE' 9 OR OBJECT_TYPE='SEQUENCE' 10 ) 11 LOOP 12 IF REC.OBJECT_TYPE='TABLE' THEN 13 EXECUTE IMMEDIATE 'DROP '||REC.OBJECT_TYPE||' '||REC.OBJECT_NAME||' CASCADE CONSTRAINTS'; 14 ELSE 15 EXECUTE IMMEDIATE 'DROP '||REC.OBJECT_TYPE||' '||REC.OBJECT_NAME; 16 END IF; 17 END LOOP; 18 END;