PL/I · DB2 SQLCODE
What does SQLCODE -305: Null Value with No Indicator Variable mean in PL/I?
A FETCH or SELECT INTO in the PL/I program retrieved a NULL column value into a host variable that has no paired indicator variable declared in the BEGIN DECLARE SECTION, so DB2 has nowhere to signal the null back to the program.
A FETCH or SELECT INTO in the PL/I program retrieved a NULL column value into a host variable that has no paired indicator variable declared in the BEGIN DECLARE SECTION, so DB2 has nowhere to signal the null back to the program.
Add an indicator variable (a FIXED BIN(15) host variable) for every nullable column in the SELECT or FETCH list, and check it after the fetch instead of trusting the data host variable when the indicator is negative.