Home | Previous Page | Next Page   Function Descriptions >

mi_fp_request( )

The mi_fp_request( ) accessor function obtains the iterator status for an iterator function from an associated MI_FPARAM structure.

Syntax

MI_SETREQUEST mi_fp_request(fparam_ptr)
   MI_FPARAM *fparam_ptr;
fparam_ptr
is a pointer to the associated MI_FPARAM structure.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

The database server sets the iterator-status field in an MI_FPARAM structure when the associated user-defined routine is an iterator function. The iterator status is one of three possible MI_SETREQUEST values.

Iterator-Status Constant Meaning Use
SET_INIT This is the first time that the iterator function is called. Initialize the user state for the iterator function.
SET_RETONE This is an actual iteration of the iterator function. Return items of the active set, one per iteration.
SET_END This is the last time that the iterator function is called. Free any resources associated with the user state.

Use the mi_fp_request( ) function in an iterator function to determine which of the preceding actions to perform for a given iteration.

Return Values

An MI_SETREQUEST constant
is the iterator-status constant of SET_INIT, SET_RETONE, or SET_END to indicate the current iterator status of the iteration function.
MI_ERROR
indicates that the function was not successful.

Related Topics

See also the description of mi_fp_setisdone( ).

For more information on how to create and call iterator functions, see the IBM Informix: DataBlade API Programmer's Guide.

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