|
The mi_exec() function sends an SQL statement to the database server for parsing, optimization, and execution.
The mi_exec() function performs the following tasks:
Tip: The mi_exec() function does not handle execution of prepared statements. To send prepared statements to the database server, use mi_exec_prepared_statement() or mi_open_prepared_statement().
The mi_exec() function only sends the statement; it does not return results to the DataBlade API module. To get results after the execution mi_exec(), the DataBlade API module must examine the results via a loop with mi_get_result().
The current statement must finish before the database server can process the next statement. The mi_query_finish() function can be used to force a statement to finish processing. Informix strongly advises that you use either mi_query_finish() or an mi_get_result() loop after each mi_exec() function.
For general information about sending statements with mi_exec(), see Using Smart Large Objects.
MI_OK | indicates that the function was successful. |
MI_ERROR | indicates that the function was not successful. |
A successful return indicates only that the connection is valid and the statement was successfully executed (for statements other than SELECT) or a cursor was successfully opened (for SELECT). It does not indicate the success of the SQL statement. Use mi_get_result() to determine the success of the SQL statement.
See the descriptions of the following functions: mi_command_is_finished(), mi_exec_prepared_statement(), mi_get_result(), mi_open_prepared_statement(), and mi_query_finish().