The mi_fp_request() function
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
- 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.
For more information about how to create and call iterator functions, see the HCL® Informix® DataBlade® API Programmer's Guide.
Return values
- An MI_SETREQUEST constant
- The iterator-status constant of SET_INIT, SET_RETONE, or SET_END to indicate the current iterator status of the iteration function.
- MI_ERROR
- The function was not successful.