您的位置:首页 > 数据库 > Oracle

【转】oracle 删除外键约束 禁用约束 启用约束 查找外键

2010-10-07 10:23 645 查看
本文来自于:http://blog.csdn.net/zhuweiliangde/archive/2010/04/03/5447430.aspx

执行以下sql生成的语句即可

删除所有外键约束

select 'alter table ' ||table_name|| ' drop constraint ' ||constraint_name|| ';' from user_constraints where constraint_type= 'R'

禁用所有外键约束

select 'alter table ' ||table_name|| ' disable constraint ' ||constraint_name|| ';' from user_constraints where constraint_type= 'R'

启用所有外键约束

select 'alter table ' ||table_name|| ' enable constraint ' ||constraint_name|| ';' from user_constraints where constraint_type= 'R'

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zhuweiliangde/archive/2010/04/03/5447430.aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: