oracle对外键约束的操作

2014-11-24 16:45:42 · 作者: · 浏览: 0

oracle对外键约束的操作
禁用所有外键约束
www.2cto.com
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';
删除所有外键约束
select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R'