当前位置:首页 > 开发 > 数据库 > 正文

oracle delete all object under an user

发表于: 2013-11-22   作者:四书五经   来源:转载   浏览:
摘要: BEGINFOR cur_rec IN(SELECT object_name, object_type FROM user_objects WHERE object_type IN('TABLE','VIEW','PACKAGE','PROCEDURE','FUNCTION','SEQUENCE', 'SYNONYM', 'TRIGGER' )) LOOP BEGINIF cur_rec.obje
BEGINFOR cur_rec IN(SELECT object_name, object_type FROM user_objects WHERE object_type IN('TABLE','VIEW','PACKAGE','PROCEDURE','FUNCTION','SEQUENCE', 'SYNONYM', 'TRIGGER' )) LOOP BEGINIF cur_rec.object_type ='TABLE'THENEXECUTE IMMEDIATE 'DROP '|| cur_rec.object_type ||' "'|| cur_rec.object_name ||'" CASCADE CONSTRAINTS';ELSEEXECUTE IMMEDIATE 'DROP '|| cur_rec.object_type ||' "'|| cur_rec.object_name ||'"';ENDIF; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ('FAILED: DROP '|| cur_rec.object_type ||' "'|| cur_rec.object_name ||'"');END;END LOOP;END;/ 

oracle delete all object under an user

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号