RPG (IBM i / AS/400) · DB2 SQLCODE
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.
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.
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.