在Oracle 数据库中,当出现 ORA-02292 错误并伴随“已找到子记录”的提示时,这通常意味着你尝试删除或更新的记录在其他表中作为外键被引用。简单来说,就是你试图删除或修改的“父”记录有一个或多个“子”记录依赖于它,而这些子记录通过外键与父记录相关联。因此,数据库不允许你删除或修改父记录,因为这会导致子...
第一步就是找到子表的记录: 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' --提示的报错信息F...
今天遇到一个问题,在删除表的时候报的错ORA-02292: 违反完整约束条件 (用户名.约束名) - 已找到子记录。 原因是:删除该表时,有依赖该表的子表数据,需要删除该条记录或者禁用约束。如果记录多,查找很不方便。所以最好就是禁用约束。那么表那么多我们怎么看约束在哪个表里呢。这里需要查询 constraint_name 表。...
第一种方法: 第一步就是找到子表的记录: 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' --...
第一步就是找到子表的记录: 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 ...
1.执行下面的语句 找到关联的子集 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 ...
ORA-02292: 违反完整约束条件 (GOADEV.FK_OZ_ORG_C_REFERENCE_OZ_ORG_O) - 已找到子记录 另外一种方法:删除表A的记录时,Oracle 报错:“ORA-02292:违反完整约束条件(XXX.FKXXX)- 已找到子记录 直接运行 select a.constraint_name, a.table_name, b.constraint_name from user_constraints ...
第一步就是找到子表的记录: 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 ...
ORA-02292: 违反完整约束条件 (用户名.约束名) - 已找到子记录: 因是:删除该表时,有依赖该表的子表数据,需要删除该条记录或者禁用约束。 内容少:可删除子数据即可。 删除之前:查找数据,相关查询语句 user_constraints 表select * from user_constraints t where t.CONSTRAINT_NAME='约束名' ...
删除表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 ...