ORA-02291

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pukars4u
Participant
Posts: 24
Joined: Tue Dec 27, 2005 6:27 pm

ORA-02291

Post by pukars4u »

Hello, I am getting the below error

ORA-02291: integrity constraint (SFADM.STG2_R_127_FK) violated - parent key not found

what should i check the data type matching or any other

guide me through
sudheer05
Participant
Posts: 30
Joined: Sun Oct 02, 2005 1:36 pm

Post by sudheer05 »

That is not the datatype issue.
Some where you are missing the parent child relation.
Check for the constraints in the database.
A foreign key value has no matching primary key value.
jzparad
Charter Member
Charter Member
Posts: 151
Joined: Thu Apr 01, 2004 9:37 pm

Post by jzparad »

This is an error from the database which basically means that you are trying to insert a record that has no matching parent record.

Example
Trying to insert an order record where the customer ID does not exist in the customer table.

Code: Select all

ORA-02291 integrity constraint (string.string) violated - parent key not found

Cause: A foreign key value has no matching primary key value.

Action: Delete the foreign key or add a matching primary key.

Jim Paradies
ak77
Charter Member
Charter Member
Posts: 70
Joined: Thu Jun 23, 2005 5:47 pm
Location: Oklahoma

Post by ak77 »

Are you trying to insert or delete?
Anyways its a database error
The ones who have replied before have given you what might be the cause.
But you have not explained clearly. Just giving the error is not enough
You can get info if you do a google search

If you are deleting a record that is linked to another parent table, then it will not allow the delete. I believe you get the same error in this case also

Kishan
jzparad
Charter Member
Charter Member
Posts: 151
Joined: Thu Apr 01, 2004 9:37 pm

Post by jzparad »

If you were trying to delete or update, you would receive a ORA-02292 (child record found) error.

And as I said (fairly clearly I thought) ...
This is an error from the database which basically means that you are trying to insert a record that has no matching parent record.
Jim Paradies
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

On the server, at the operating system prompt, type this command.

Code: Select all

oerr ORA 02291
This will (a) prove to you that it's an Oracle error (not a DataStage error), (b) suggest what you can do about it.
Then you can modify your job design so that you do not violate a foreign key constraint - maybe by loading the dimension table ahead of the fact table.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pukars4u
Participant
Posts: 24
Joined: Tue Dec 27, 2005 6:27 pm

Post by pukars4u »

Thanks guys my problem is solved its not a datatype error its really is parent-child relation error
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Correct. You read this in the original error message.

Code: Select all

ORA-02291: integrity constraint (SFADM.STG2_R_127_FK) violated - parent key not found 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply