删除表A的记录时,Oracle 报错:“ORA-02292:违反完整约束条件(XXX.FKXXX)- 已找到子记录。

1、找到以”FKXXX“为外键的表A的子表,直接运行

select a.constraint_name, a.table_name, b.constraint_name
from user_constraints a, user_constraints b
where a.constraint_type = 'R'
and b.constraint_type = 'P'
and a.r_constraint_name = b.constraint_name
and a.constraint_name = 'FKXXX'

2、删除相应的子表记录

3、删除主表记录

原文:https://blog.csdn.net/Dreamcode/article/details/38367673

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-09-01
猜你喜欢
  • 2021-09-26
  • 2022-12-23
  • 2022-01-31
  • 2022-01-13
  • 2022-12-23
  • 2021-07-15
相关资源
相似解决方案