Return a NULL value

To return an SQL NULL value from a user-defined function, pass the MI_FPARAM structure as the last argument in the UDR and use the mi_fp_setreturnisnull() function to set the NULL value in this MI_FPARAM structure.

You must call the mi_fp_setreturnisnull() function with MI_TRUE before your UDR completes. If you do not, you might receive an incorrect result from the UDR. Do not just return a NULL-valued pointer. For more information, see Return a NULL value.