Toc
  1. 组装禁用所有外键的语句
  2. 组装启用所有外键的语句
  3. 组装删除所有外键的语句
  4. 查询所有外键
0 results found
liang
外键操作SQL生成
2019/11/18 数据库
组装禁用所有外键的语句
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';
查询所有外键
select t.status,t.* from user_constraints t where constraint_type='R';
打赏
支付宝
微信
本文作者:liang
版权声明:本文首发于liang的博客,转载请注明出处!