The mi_fp_returnisnull() function

The mi_fp_returnisnull() accessor function determines whether the return value of a user-defined function is an SQL NULL from its associated MI_FPARAM structure.

Syntax

mi_boolean mi_fp_returnisnull(fparam_ptr, ret_pos)
   MI_FPARAM *fparam_ptr;
   mi_integer ret_pos;
fparam_ptr
A pointer to the associated MI_FPARAM structure.
ret_pos
The index position into the null-return array for the return value to check for a NULL value. For user-defined functions, the only valid value is 0.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_fp_returnisnull() function determines whether the routine return value at position ret_pos in the MI_FPARAM structure that fparam_ptr references contains the SQL NULL value. The MI_FPARAM structure stores information about whether function return values are NULL in the zero-based null-return array. To obtain information about the nth return value, use a ret_pos value of n-1. For example, the following call to mi_fp_returnisnull() determines whether the first return value of the my_func() user-defined function, with which fparam1 is associated is NULL:
mi_integer my_func(..., fparam1)
   ...
   MI_FPARAM *fparam1;
{
   if ( mi_fp_returnisnull(fparam1, 0) == MI_TRUE )
      /* code to handle NULL return value */
Important: C user-defined functions always have only one return value.

For more information about return-value information in an MI_FPARAM structure, see the Informix® DataBlade® API Programmer's Guide.

Return values

MI_TRUE
The return value at position ret_pos is NULL.
MI_FALSE
The return value at position ret_pos is not NULL.
MI_ERROR
The function was not successful.