UNSAFENULL PRECOMPILE option

You can suppress the unspecified indicator variable error by setting the UNSAFENULL YES option in the PRECOMPILE command, when you set the precompiler option COMPATIBILITY_MODE to ORA.

The unspecified indicator variable error is generated when the NULL value exists but the embedded SQL application failed to specify the NULL indicator.
# Suppress SQL0305N error.
db2 prep test.sqc COMPATIBILITY_MODE ORA UNSAFENULL YES

# Default behavior if null value is retrieved, SQL0305N error
db2 prep test.sqc COMPATIBILITY_MODE ORA UNSAFENULL NO
db2 prep test.sqc COMPATIBILITY_MODE ORA
db2 prep test.sqc

# Below both PRECOMPILE option give error as COMPATIBILITY_MODE ORA is not set.
db2 prep test.sqc UNSAFENULL YES
db2 prep test.sqc UNSAFENULL NO
Remember: Even if you do not set the COMPATIBILITY_MODE parameter to ORA while precompiling, an application can check the sqlca.sqlerrd[2] structure to get the cumulative sum of the number of rows that were successfully populated until the last fetch in non-array host variables.