假如有主表 test_main 与 子表 test_sub
SQL -- 创建外键(默认选项)
SQL ALTER TABLE test_sub ADD CONSTRAINT main_id_cons FOREIGN KEY (main_id) REFERENCES test_main;
Table altered.
删除外键约束
ALTER TABLE test_sub DROP CONSTRAINT main_id_cons;
增加外键:
-- 删除外键
alter table 表名 drop constraint 外键名;
select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R';
祝贺楼主成功.
①.楼说的怎么可能?只要删除外键约束了,然后你就可以删除这个表的数据,不会影响到引用外键的表.
以上就是土嘎嘎小编为大家整理的oracle如何去除外键相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!