Parameter null indicators in C and C++ routines

If the parameter style chosen for a C or C++ routine (procedure or function) requires that a null indicator parameter be specified for each of the SQL parameters, as is required by parameter style SQL and GENERAL, the null indicators are to be passed as parameters of data type SQLUDF_NULLIND*. For parameter style GENERAL WITH NULLS, they must be passed as an array of type SQLUDF_NULLIND.

This data type is defined in embedded SQL application and routine include file: sqludf.h.

Null-indicator parameters indicate whether the corresponding parameter value is equivalent to NULL in SQL or if it has a literal value. If the null indicator value for a parameter is 0, this indicates that the parameter value is not null. If the null-indicator value for a parameter is -1, the parameter is to be considered to have a value equivalent to the SQL value NULL.

When null indicators are used it is important to include code within your routine that:
  • Checks null-indicator values for input parameters before using them.
  • Sets null indicator values for output parameters before the routine returns.