The mi_fp_nrets() function

The mi_fp_nrets() accessor function obtains the number of return values for the UDR from its associated MI_FPARAM structure.

Syntax

mi_integer mi_fp_nrets(fparam_ptr)
   MI_FPARAM *fparam_ptr;
fparam_ptr
A pointer to the associated MI_FPARAM structure.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

You can use the mi_fp_nrets() function with the DataBlade® API functions that obtain information about each return value of the UDR (such as mi_fp_rettype() and mi_fp_returnisnull()). For example, the following call to mi_fp_nrets() obtains the number of return values from the MI_FPARAM structure that fparam1 identifies and uses the value in a loop to obtain the length of each return value:
ret_count = mi_fp_nrets(fparam1);
for (i = 0; i < ret_count; i++)
   {
   ret_len[i] = mi_fp_retlen(fparam1, i);
   ...
Important: C user-defined functions 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

>=0
The number of values that the UDR returns.
MI_ERROR
The function was not successful.