Upsert Error while trying to Update and Insert
Posted: Thu Aug 05, 2010 8:21 am
Hi,
I created One Dataset with one record with PolicyNumber as Key Column and I am trying to insert it into a DB2 table using ODBC Enterprise Stage with a reject link going to a sequential File Stage. Well the Table to which I am inserting is a Child Table to a Parent table having same PolicyNumber as Key Column.
In the Dataset I created have a PolicyNumber which have no records in Parent Table. Now my expectation would be if I try to insert the record in the child table the record should get rejected and go into a sequential file stage returning some SQLCODE saying that the Foreign Key RelationShip got failed. But The job is getting Failed saying in the log
APT_CombinedOperatorController,0: Fatal Error: [IBM][CLI Driver][DB2] SQL0530N The insert or update value of the FOREIGN KEY "FQA551" is not equal to any value of the parent key of the parent table. SQLSTATE=23503
My question is, if we are trying to insert or update if some foreign key relation ship fails, is it going to reject the records or is it going to fail the whole job?
If you think the post is not elobarative enough Please let me know. I can explain you clearly.
I created One Dataset with one record with PolicyNumber as Key Column and I am trying to insert it into a DB2 table using ODBC Enterprise Stage with a reject link going to a sequential File Stage. Well the Table to which I am inserting is a Child Table to a Parent table having same PolicyNumber as Key Column.
In the Dataset I created have a PolicyNumber which have no records in Parent Table. Now my expectation would be if I try to insert the record in the child table the record should get rejected and go into a sequential file stage returning some SQLCODE saying that the Foreign Key RelationShip got failed. But The job is getting Failed saying in the log
APT_CombinedOperatorController,0: Fatal Error: [IBM][CLI Driver][DB2] SQL0530N The insert or update value of the FOREIGN KEY "FQA551" is not equal to any value of the parent key of the parent table. SQLSTATE=23503
My question is, if we are trying to insert or update if some foreign key relation ship fails, is it going to reject the records or is it going to fail the whole job?
If you think the post is not elobarative enough Please let me know. I can explain you clearly.