The mi_save_set_get_first() function
The mi_save_set_get_first() function retrieves the first row from a save set.
Syntax
MI_ROW *mi_save_set_get_first(save_set, error)
MI_SAVE_SET *save_set;
mi_integer *error;
- save_set
- A pointer to an MI_SAVE_SET structure.
- error
- A pointer to a return code.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | Yes |
Usage
The mi_save_set_get_first() function obtains the first 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 first row is the row most recently added to the save set; that is, it is the row at the top of the queue. This save set must have been previously created with the mi_save_set_create() function.
When
the mi_save_set_get_first() function is successful,
it returns a pointer to the row structure for the first row. It also
moves the cursor position to point to the first row as the current
row in the save set. If the save set is empty, the function takes
the following steps:
- Returns the NULL-valued pointer
- Sets the error argument to MI_NO_MORE_RESULTS
Return values
- An MI_ROW pointer
- A pointer to the first row in the specified save set.
- NULL
- The function was not successful or that the save set is empty.
Upon failure, mi_save_set_get_first() returns NULL and sets error to MI_ERROR.