mi_integer mi_fetch_statement(stmt_desc, cursor_action, jump, num_rows) MI_STATEMENT *stmt_desc; MI_CURSOR_ACTION cursor_action; mi_integer jump; mi_integer num_rows;
Valid in Client LIBMI Application? | Valid in User-Defined Routine? |
---|---|
Yes | Yes |
The mi_fetch_statement( ) function fetches num_rows rows from the cursor_action orientation into an explicit cursor, which mi_open_prepared_statement( ) has opened. The mi_fetch_statement( ) function does not return any rows to the DataBlade API module but copies retrieved rows from the database server into the row cursor that is associated with the stmt_desc statement descriptor. To access a row, use the mi_next_row( ) function, which retrieves the row from the cursor. After you access all rows in the cursor, mi_next_row( ) returns the NULL-valued pointer and sets its error argument to MI_NO_MORE_RESULTS.
To specify the number of rows to fetch, use the num_rows argument.
See also the descriptions of mi_get_result( ), mi_next_row( ), mi_open_prepared_statement( ), mi_prepare( ), and mi_result_row_count( ).