Andreas_Sprosec_7439

Error during importing data (DB2)

Discussion created by Andreas_Sprosec_7439 on Aug 7, 2017


You Asked


During importing data following error occur:

U00003592 UCUDB - Status: '23503' NativeError: '-530' Msg: ' SQL0530N THE INSERT OR UPDATE VALUE OF FOREIGN KEY constraint-name IS INVALID. SQLSTATE=23503'


And we said …


Explanation:

An insert or update operation attempted to place a value in a foreign key of the object table; however, this value was not equal to some value of the parent key of the parent table.

When a row is inserted into a dependent table, the insert value of a foreign key must be equal to the value of the parent key of some row of the parent table in the associated relationship.

When the value of the foreign key is updated, the update value of a foreign key must be equal to the value of the parent key of some row of the parent table of the associated relationship. 

System action

The UPDATE, MERGE, or INSERT statement cannot be executed. The object table is unchanged. 

Programmer response

Examine the insert or update value of the foreign key first, and then compare it with each of the parent key values of the parent table to determine the cause of the problem. 

SQLSTATE

23503

Outcomes