生成约束修改语句

2014-11-24 16:51:52 · 作者: · 浏览: 0
生成约束修改语句
  Sql代码

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

  启用所有外键约束
  Sql代码

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