The database server uses the function-parameter structure, MI_FPARAM, to tell a DataBlade iterator function about which iteration operation to perform next. To have a DataBlade function return more than one value (or row), you must define it as an iterator function. An iterator function can return more than one value from one of the following conditions:
Initializes the active set
The first time that the DataBlade function is called
SET_INIT
Returns one value/row from the active set
For each row in the active set
SET_RETONE
Shuts down the active set
After the last row is returned from the active set
SET_END
The DataBlade iterator function must record enough information to return values one at a time on demand. Declare the iterator function so that its return value matches one of the return values of the active set. For example, to return an active set of integer values, declare the iterator function to return an integer. The following code fragment is a sample implementation of an iterator function called get_orders(), which generates an active set of order numbers for a given customer number and then iterates through the active set to return each order number: