启用失效 外键

--disable fk
SELECT 'ALTER TABLE '|| table_name || ' DISABLE CONSTRAINTS ' || t.constraint_name ||';'
FROM user_constraints t
WHERE t.constraint_type = 'R';

--enable fk
SELECT 'ALTER TABLE '|| table_name || ' ENABLE CONSTRAINTS ' || t.constraint_name ||';'
FROM user_constraints t
WHERE t.constraint_type = 'R';

 

posted @ 2018-08-10 21:55  Nina  阅读(175)  评论(0编辑  收藏  举报