Handling NULL arguments

By default, a C UDR does not handle SQL NULL values. When you call a UDR with an SQL NULL as the argument, the routine manager does not invoke the UDR. It returns a value of SQL NULL for the UDR.

To have the UDR invoked when it is called with SQL NULL arguments, register the UDR with the HANDLESNULLS routine modifier and code the UDR to take special steps when it receives a NULL argument.

To determine whether an argument is SQL NULL, declare the MI_FPARAM structure as the last argument in the UDR and use the mi_fp_argisnull() function to check for NULL argument values. Do not just compare the argument with a NULL-valued pointer. For more information, see Handling NULL arguments with MI_FPARAM.