oracle 清空当前用户所有对象
时间:2021-07-01 10:21:17
帮助过:3人阅读
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;
oracle 清空当前用户所有对象
标签:color loop pack cut ora table else obj for