In this post, you’ll learn about the error message -531 the primary key in a parent row cannot be updated because it has one or more dependent rows in relationship constraint name in the IBM DB2 database , the reason why it occurs along with the solution to fix it
IBM DB2 Error Message
-531 the primary key in a parent row cannot be updated because it has one or more dependent rows in relationship constraint name
Reason for the Error
An UPDATE operation attempted to update a primary key in the specified row of the object table; however, the primary key in the specified row had dependent rows associated with it.The value of a primary key in a parent row cannot be updated if the parent row has any dependent rows.
Solution
Examine the primary key of the object table and the foreign key of the dependent table to determine if the value of the specified row of the primary key should be changed.� If this does not expose the problem, examine the contents of the object table and the dependent table to determine the cause of the problem.