Oracle 外键查询和操作


临时禁止外键:
alter table EMP modify constraint FK_DEPTNO disable;

查询依赖某个表上主键的所有外键:
select *
  from user_constraints t
where t.constraint_type = 'R'
   and t.r_constraint_name in
       (select p.constraint_name
          from user_constraints p
         where p.constraint_type = 'P'
           and p.table_name = 'xxx')



猜你喜欢

转载自dbaspider.iteye.com/blog/2202924
今日推荐