SQLCODE -532
SQL0532 Delete prevented by referential constraint
- IBM message text
- Delete prevented by referential constraint &1 in &2.
- SQLCODE
- -532
- SQLSTATE
- 23001, 23504
Most common cause
DELETE of a parent row that has child rows, with a RESTRICT or NO ACTION rule.
Other causes
- A referential constraint added without the program accounting for it.
How to fix it
Delete the child rows first, or consider ON DELETE CASCADE if that is the intended behaviour.
Related errors
Text and codes from IBM documentation for 7.6. Checked on .