The mi_fp_nargs() function
The mi_fp_nargs() accessor function obtains the number of arguments for the UDR routine from its associated MI_FPARAM structure.
Syntax
mi_integer mi_fp_nargs(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_nargs() function
with the DataBlade®
API functions
that obtain information about each argument of the UDR routine (such
as mi_fp_argtype() and mi_fp_argisnull()).
For example, the following call to mi_fp_nargs() obtains
the number of arguments from the MI_FPARAM structure that fparam1 identifies
and uses the value in a loop to obtain the length of each argument:
arg_count = mi_fp_nargs(fparam1);
for (i = 0; i < arg_count; i++)
{
arg_len[i] = mi_fp_arglen(fparam1, i);
For more information about argument information in an MI_FPARAM structure, see the Informix® DataBlade® API Programmer's Guide.
Return values
- >=0
- The number of arguments with which the UDR was called.
- MI_ERROR
- The function was not successful.