|
|
Re: ORA-02298 cannot validate - Parent keys not found [message #546383 is a reply to message #546381] |
Tue, 06 March 2012 07:19   |
muralikri
Messages: 638 Registered: August 2011 Location: chennai
|
Senior Member |

|
|
Master table...
ALTER TABLE emp1 ADD CONSTRAINT fk_orders1 FOREIGN KEY (deptno) REFERENCES dept(deptno);
select deptno from dept
DEPTNO
----------
10
20
30
40
Insert into EMP1 (EMPNO, ENAME, JOB, MGR, SAL, DEPTNO, HIREDATE, COMM)
Values (123, 'SMITH', 'CLERK', 7902, 153, 50, TO_DATE('06/23/2011 16:21:41', 'MM/DD/YYYY HH24:MI:SS'), 8);
ORA-02291: integrity constraint (ACXIOM_RD.FK_ORDERS1) violated - parent key not found
|
|
|
|
|
|
Re: ORA-02298 cannot validate - Parent keys not found [message #546397 is a reply to message #546395] |
Tue, 06 March 2012 08:48  |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
And since integrity constraints exist for a reason, if you have to disable one then you are almost certainly doing something wrong.
I'm betting you deleted a parent row without deleting the child rows first.
You should have deleted the child rows, then the parent, and not touched the foreign key.
Now you'll need to find the ophaned child rows and delete them and hope nothing else has mangled the rest of the data in the mean time.
|
|
|