The implicit row cursor
When mi_exec() executes a query, it automatically opens an implicit cursor to hold the resulting rows. This cursor is associated with the current statement and is stored as part of the connection descriptor. Therefore, only one cursor per connection can be current.
Tip: If the implicit cursor that mi_exec() creates
does not adequately meet the needs of your DataBlade®
API module,
you can use the mi_open_prepared_statement() function
to define other types of cursors.
When the mi_exec() function successfully fetches the query results into the cursor, the cursor position points to the first row of the cursor, and the mi_get_result() function returns a status of MI_ROWS to indicate that the cursor contains rows.
You can access these rows one at a time with the mi_next_row() function. Each access obtains the row to which the cursor position points. After each access to the cursor, the cursor position moves to the next row.