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

SQLCODE +100 - No Data Found

What does SQLCODE +100 - No Data Found mean in RPG (IBM i / AS/400)?

A SELECT INTO, singleton FETCH, searched UPDATE, or searched DELETE found no matching row. In an SQLRPGLE program this is the SQL equivalent of end-of-file on a native READ - it just comes back through SQLCODE/SQLSTATE ('02000') instead of an indicator.

SQLCODE +100 - No Data FoundDB2 for i · SQLRPGLE

Condition

A SELECT INTO, singleton FETCH, searched UPDATE, or searched DELETE found no matching row. In an SQLRPGLE program this is the SQL equivalent of end-of-file on a native READ - it just comes back through SQLCODE/SQLSTATE ('02000') instead of an indicator.

Fix

After every FETCH or SELECT INTO, check SQLCODE = 100 the same way you'd check %EOF() on a native read, and exit the fetch loop or handle the not-found case explicitly instead of letting the next FETCH run against an exhausted cursor.

Related db2 sqlcode