Home | Previous Page | Next Page   Programming DataBlade Module Routines in C > Editing Routines in udr.c >

Iterator Functions

If you create an iterator function that returns a set one row at a time, BladeSmith adds code to process the set. The Informix database server calls iterator functions repeatedly to process all of the return values.

The Generated Code

In addition to the arguments you specified when creating it, an iterator function contains an MI_FPARAM argument. The Informix database server uses an MI_FPARAM structure to control iteration over the set. The generated code includes a C switch statement with different cases to process the set. The switch statement uses the mi_fp_request() function to obtain the request flag from the MI_FPARAM structure. The Informix database server sets this flag to one of the following values before calling the function:

In the generated code, each of these sections has a TO DO: note. To avoid code merging problems, make changes only where indicated.

Completing the Code

To complete the iterator code, you must:

For more information on programming iterator functions, see the IBM Informix: DataBlade API Programmer's Guide.

Example

The LoanAmortization() function in the Business DataBlade module is an iterator function.

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