The mi_fp_setreturnisnull() function

The mi_fp_setreturnisnull() accessor function sets the value of a return value of a user-defined function to an SQL NULL in its associated MI_FPARAM structure.

Syntax

void mi_fp_setreturnisnull(fparam_ptr, ret_pos, is_null)
   MI_FPARAM *fparam_ptr;
   mi_integer ret_pos;
   mi_integer is_null;
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 set to NULL. For C user-defined functions, the only valid value is 0.
is_null
The value that determines whether the ret_pos+1 return value is NULL. You can specify the following values for the is_null argument:
MI_FALSE
The return value that ret_pos identifies is not NULL.
MI_TRUE
The return value that ret_pos identifies is NULL.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_fp_setreturnisnull() function sets the function return value at position ret_pos in the MI_FPARAM structure that fparam_ptr references to the appropriate SQL NULL value. The MI_FPARAM structure stores information about whether function return values are NULL in the zero-based null-return array.

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

To set the nth return value, use a ret_pos value of n-1.

For example, the following call to mi_fp_setreturnisnull() sets to NULL the first return value of the my_func() UDR, with which fparam1 is associated:
mi_integer my_func(..., fparam1)
...
   MI_FPARAM *fparam1;
{
   ...
   mi_fp_setreturnisnull(fparam1, 0, MI_TRUE);
Important: C user-defined functions always have only one return value.

Return values

None.