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

-530

Foreign key value invalidNEGATIVE SQLCODE · CHECKED 2026-11-14
Checked against IBM documentation

An insert or update put a value in a foreign key that does not equal any parent key value in the parent table.

QUICK ANSWER

An insert or update put a value in a foreign key that does not equal any parent key value in the parent table.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. An INSERT puts a foreign key value in the dependent table that has no matching parent key.
  2. An UPDATE changes a foreign key to a value that has no matching parent key.
  3. For a temporal constraint, the child BUSINESS_TIME value is not covered by contiguous parent BUSINESS_TIME periods.

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

MOST LIKELY

An INSERT puts a foreign key value in the dependent table that has no matching parent key.

FIRST CHECK

Examine the insert or update value of the foreign key.

TRY IT ▸

Site search

What it means

A foreign key value must match the parent key of some row in the parent table. The message names the constraint. SQLSTATE is 23503.

For a temporal referential constraint, the BUSINESS_TIME value must also fall within the parent rows' BUSINESS_TIME periods.

Typical causes

  • An INSERT puts a foreign key value in the dependent table that has no matching parent key.
  • An UPDATE changes a foreign key to a value that has no matching parent key.
  • For a temporal constraint, the child BUSINESS_TIME value is not covered by contiguous parent BUSINESS_TIME periods.

How to fix it

  1. Examine the insert or update value of the foreign key.
  2. Compare it with each parent key value in the parent table.
  3. Insert the parent row first, or correct the foreign key value.