informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_exec()

The mi_exec() function sends an SQL statement to the database server for parsing, optimization, and execution.

Syntax

Usage

The mi_exec() function performs the following tasks:

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.

Return Values

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.

Related Topics

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().


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved