integrity constraint violations while inserting values [message #375426] |
Sat, 21 October 2000 14:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Shirley
Messages: 8 Registered: August 2000
|
Junior Member |
|
|
I successfully created a table. I am attempting to insert values and get the following error message:
INSERT INTO EMPLOYEE VALUES( *
ERROR at line 1:
ORA-02291: integrity constraint (SCOTT.SYS_C001296) violated - parent key not found
Do you know what may be the problem? Please help!!!
|
|
|
Re: integrity constraint violations while inserting values [message #375432 is a reply to message #375426] |
Mon, 23 October 2000 06:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Gs
Messages: 8 Registered: September 2000
|
Junior Member |
|
|
Hi,
I guest the problem is b' cos of the Foreign key.
One of the column in table EMPLOYEE should be a foreign key to another table, and when we try to insert a value which not exist in the references table, Assume ...
We create following tables ...
EMPLOYEE table : empno, name, deptno ... etc
DEPT table : deptno, description ... etc
and the deptno in EMPLOYEE is FK for DEPT
------------------------------------------
From the above example, before we insert the
EMPLOYEE table for 'deptno' column, the
values must exist in 'deptno' in DEPT table.
Hope the above helps.
|
|
|