Home | Previous Page | Next Page   Function Descriptions >

mi_fp_argisnull( )

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

Syntax

mi_unsigned_char1 mi_fp_argisnull(fparam_ptr, arg_pos)
   MI_FPARAM *fparam_ptr;
   mi_integer arg_pos;
fparam_ptr
is a pointer to the associated MI_FPARAM structure.
arg_pos
is the index position into the null-argument array for the argument to check for a NULL value.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

The mi_fp_argisnull( ) function determines whether the routine argument at position arg_pos in the MI_FPARAM structure that fparam_ptr references contains the SQL NULL value. The MI_FPARAM structure stores information about whether routine arguments contain the NULL value in the zero-based null-argument array. Therefore, to obtain information about the nth argument, use an arg_pos value of n-1. For example, the following call to mi_fp_argisnull( ) determines whether the third argument of the my_func( ) UDR is NULL:

mi_integer my_func(..., fparam1)
   ...
   MI_FPARAM *fparam1;
{
   ...
   if ( mi_fp_argisnull(fparam1, 2) == MI_TRUE )
      /* code to handle NULL argument */

Routines that handle NULL arguments must be registered with the HANDLESNULLS routine modifier of the CREATE FUNCTION or CREATE PROCEDURE statement.

Return Values

MI_TRUE
indicates that the argument at position arg_pos is NULL.
MI_FALSE
indicates that the argument at position arg_pos is not NULL.
MI_ERROR
indicates that the function was not successful.

Related Topics

See also the descriptions of mi_fp_arglen( ), mi_fp_argprec( ), mi_fp_argscale( ), mi_fp_argtype( ), mi_fp_returnisnull( ), mi_fp_setargisnull( ), and mi_fp_setreturnisnull( ).

For more information about argument information in an MI_FPARAM structure, see the IBM Informix: DataBlade API Programmer's Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]