Home | Previous Page | Next Page   Function Descriptions >

mi_save_set_get_next( )

The mi_save_set_get_next( ) function traverses a save set in the forward direction.

Syntax

MI_ROW *mi_save_set_get_next(save_set, error)
   MI_SAVE_SET *save_set;
   mi_integer *error;
save_set
is a pointer to an MI_SAVE_SET structure.
error
is a pointer to a return code.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

The mi_save_set_get_next( ) function obtains the next row from the save set that save_set references. Because the DataBlade API maintains a save set as an FIFO (first-in, first-out) queue, the next row is the row added to the save set just before the current row; that is, it is the next row towards the bottom of the queue. This save set must have been previously created with mi_save_set_create( ).

When the mi_save_set_get_next( ) function is successful, it returns a pointer to the row structure for the next row. It also moves the cursor position to point to the next row as the current row in the save set. The mi_save_set_get_next( ) function is typically executed in a loop that terminates when no more rows remain to be fetched from the save-set cursor (the cursor position is at the end of the cursor). To indicate the "no more rows" condition, the function takes the following steps:

  1. Returns the NULL-valued pointer
  2. Sets the error argument to MI_NO_MORE_RESULTS

Return Values

An MI_ROW pointer
is a pointer to the next row forward in the specified save set.
NULL
indicates that the function was not successful or no more rows remain to be retrieved from the save-set cursor.

Upon failure, mi_save_set_get_next( ) returns NULL and sets error to MI_ERROR.

Related Topics

See also the descriptions of mi_save_set_get_first( ), mi_save_set_get_last( ), and mi_save_set_get_previous( ).

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