Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

-532

Delete restricted by a referential constraintNEGATIVE SQLCODE · CHECKED 2026-11-14
Checked against IBM documentation

A DELETE failed because a dependent row exists in a relationship with a RESTRICT or NO ACTION delete rule, directly or through a cascade.

QUICK ANSWER

A DELETE failed because a dependent row exists in a relationship with a RESTRICT or NO ACTION delete rule, directly or through a cascade.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. A parent row still has dependent rows in a table with a RESTRICT or NO ACTION delete rule.
  2. A cascading delete reaches a dependent row that is protected by RESTRICT or NO ACTION.
  3. A partition rotation cannot reuse the partition because of a DELETE RESTRICT referential constraint.

CHECKED 14 Nov 2026 IBM: Db2 13 for z/OS: SQLCODE -532 (Db2 for z/OS 13.0.0)

TRY IT: BLOCK SIZE AND SPACE CALCULATOR ▸

MOST LIKELY

A parent row still has dependent rows in a table with a RESTRICT or NO ACTION delete rule.

FIRST CHECK

Examine the delete rule of all descendant tables.

TRY IT ▸

Block size and space calculator

What it means

A row cannot be deleted because it has a dependent in a relationship whose delete rule is RESTRICT or NO ACTION, or because the deletion cascades to such a dependent. SQLSTATE is 23504.

The same code can occur for ALTER TABLE with ALTER PART ROTATE FIRST TO LAST when a DELETE RESTRICT constraint blocks reuse of the partition.

Typical causes

  • A parent row still has dependent rows in a table with a RESTRICT or NO ACTION delete rule.
  • A cascading delete reaches a dependent row that is protected by RESTRICT or NO ACTION.
  • A partition rotation cannot reuse the partition because of a DELETE RESTRICT referential constraint.

How to fix it

  1. Examine the delete rule of all descendant tables.
  2. Use the constraint name in the message to identify the tables involved, and the RID in the message to find the descendant row.
  3. Remove or reassign the dependent rows first, or revisit the delete rule design.