ITPub博客

首页 > Linux操作系统 > Linux操作系统 > sql删除外键

sql删除外键

原创 Linux操作系统 作者:伊思 时间:2010-03-29 22:20:23 0 删除 编辑

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

删除所有外键约束 

Sql代码 复制代码
  1. select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R'  

 禁用所有外键约束

Sql代码 复制代码
  1. select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R'  

启用所有外键约束

Sql代码 复制代码
  1. select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R'  

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23163255/viewspace-630717/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-01-10

  • 博文量
    43
  • 访问量
    111057