Handling no more results status

The mi_get_result() function returns a status of MI_NO_MORE_RESULTS to indicate that statement processing for the current statement is complete.

The function can return MI_NO_MORE_RESULTS when any of the following conditions occur for the current statement:
  • When the cursor is empty after mi_open_prepared_statement() has opened the cursor and before mi_fetch_statement() has fetched rows into this cursor.
  • After mi_next_row() has retrieved the last row from the cursor.
  • When the query is complete, after mi_query_finish() or mi_query_interrupt() has executed.
  • When any non-query statement is complete: after mi_get_result() has returned the MI_DML or MI_DDL statement status.
Tip: When a SELECT or FETCH statement encounters NOT FOUND (or END OF DATA), the database server sets SQLSTATE to "02000" (class = "02"). However, the NOT FOUND condition does not generate a database server exception.