禁用外键
- select 'alter table '|| t.table_name||' disable constraint '||t.constraint_name||';'
- from user_constraints t where t.constraint_type = 'R'
- order by t.table_name
select 'alter table '|| t.table_name||' disable constraint '||t.constraint_name||';'
from user_constraints t where t.constraint_type = 'R'
order by t.table_name
启用外键
- select 'alter table '|| t.table_name ||' enable constraint '||t.constraint_name||';'
- from user_constraints t where t.constraint_type = 'R'
- order by t.table_name
本文提供了一种简便的方法来批量禁用与启用数据库中的外键约束,这对于进行大规模的数据操作时避免外键冲突非常有用。
1078

被折叠的 条评论
为什么被折叠?



