DB Version:10gR2
In the below example, i have a self referencing foreign key mgr. When i DELETE records
i don't get an ORA-02292 error from the self referencing FK.
create table emp2
(
empno number primary key,
mgr number references emp2( empno )
);
Table created.
INSERT INTO EMP2 VALUES (2,2);
INSERT INTO EMP2 VALUES(3,NULL);
INSERT INTO EMP2 VALUES (4,3);
COMMIT;
SQL>DELETE FROM EMP2;
3 rows deleted.
But in one of our Production tables which has a self referential FK, i get an error similair to
ERROR at line 1:
ORA-02292: integrity constraint (SCOTT.EMP2_FK) violated - child record found
when i try to delete records.Any idea why i am getting this error?