RPG (IBM i / AS/400) · DB2 SQLCODE

SQLCODE -531 - Parent Key Update/Delete Restricted

What does SQLCODE -531 - Parent Key Update/Delete Restricted mean in RPG (IBM i / AS/400)?

An UPDATE or DELETE against a parent table's key column was blocked because one or more child rows still reference that key and the foreign key constraint's rule is RESTRICT or NO ACTION.

SQLCODE -531 - Parent Key Update/Delete RestrictedDB2 for i · SQLRPGLE

Condition

An UPDATE or DELETE against a parent table's key column was blocked because one or more child rows still reference that key and the foreign key constraint's rule is RESTRICT or NO ACTION.

Fix

Remove or update the dependent child rows first, or revisit the constraint's delete/update rule if cascading is actually the intended behavior, then re-run the operation.

Related db2 sqlcode