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

SQLCODE -305 - Null Value With No Indicator

What does SQLCODE -305 - Null Value With No Indicator mean in RPG (IBM i / AS/400)?

A FETCH or SELECT INTO tried to move a NULL column value into a host variable that has no associated null indicator, so SQL has nowhere to record that the value came back null.

SQLCODE -305 - Null Value With No IndicatorDB2 for i · SQLRPGLE

Condition

A FETCH or SELECT INTO tried to move a NULL column value into a host variable that has no associated null indicator, so SQL has nowhere to record that the value came back null.

Fix

Add a null indicator (or indicator array) to every host variable mapped to a nullable column, and check the indicator right after the fetch before using the value in RPG logic.

Related db2 sqlcode