Page 1 of 1

Integrity constraint

Posted: Wed Sep 13, 2006 11:58 am
by vardhan354
Hi,

i am getting the following error, the records are not loaded into the target, and giving warning messages.

ORA-02291: integrity constraint (schema name.CONTACT_PERS_FK) violated - parent key not found
DBMS.CODE=ORA-02291

Please help me.

Thanks in advance.

Posted: Wed Sep 13, 2006 12:02 pm
by kris007
It's complaining about ForeignKey violation. Check your constraints on the table you are trying to load. The key you are trying to load into the table doesn't exist(and is supposed to exist) in the parent table.

Posted: Wed Sep 13, 2006 12:05 pm
by thumsup9
You will find more on this in the forum. Your Parent table is missing some key vlaues and you may have to investigate why they are missing in there.

viewtopic.php?t=93704&highlight=parent+key+not+found

Posted: Wed Sep 13, 2006 12:58 pm
by vardhan354
i loaded the parent job first, Again i am getting the same error,
can i use lookup with that table with this job and load the data,

which option is better:-

drop the constraint (or) using lookup with the table.

on the same column.

Please help me.

Thanks,

Posted: Wed Sep 13, 2006 1:02 pm
by kris007
vardhan354 wrote: i loaded the parent job first, Again i am getting the same error,
It either means that you are doing something wrong in the job or the data in the table is incorrect.
vardhan354 wrote: can i use lookup with that table with this job and load the data,
which option is better:-
drop the constraint (or) using lookup with the table.
on the same column.
Can you explain this in detail?

Posted: Wed Sep 13, 2006 1:06 pm
by DSguru2B
Well the RI doesnt just restrict itself to parent child relationship. You could be loading a code value into the table and that code value must be missing in the code table. See if thats the case.

Posted: Wed Sep 13, 2006 1:07 pm
by vardhan354
I mean supose there are two tables.

table A, table B

table A --- parent table

i already loaded the data into tableA.

now when i am trying to load the data into tableB, it is giving integrity constraint error.

My opinion if lookup with parent table (table A) and table B on column which we are getting integrity constraint (key violation).

is this work.

Posted: Wed Sep 13, 2006 1:11 pm
by vardhan354
Hi DSGURU,

please explain clearly how to check the codevalue and what is the code value.

Thanks

Posted: Wed Sep 13, 2006 1:23 pm
by DSguru2B
Well, with the lack of info about your business, i cannot tell you that, thats for you to investigate. Code columns usually end with _CD. See if you have any such column that you are loading.
I am not saying that this is the problem, it might be. Chances are more of you missing a record load in the parent table and loading it in the child table.
Have a reject link coming out of your transformer with the constraint as
LoadLink.REJECTED where LoadLink is the name of the link thats going into your database. This way you will capture all such records which are rejected. Investigate those values in the parent table and see why are they not getting loaded in the parent table.

Posted: Wed Sep 13, 2006 1:43 pm
by vardhan354
I am using the reject link,

but i am getting the rejected rows, beside the rejected rows i am getting the warnings with row information, warning of integrity constraint.

Posted: Wed Sep 13, 2006 1:57 pm
by DSguru2B
Yes, when a row will be rejected, you will get warning messages. Now you have to look into those rejected rows and investigate why the FK column value is not present in the parent table. This will give you a good starting point for your investigations.