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

mi_get_result()

The mi_get_result() function returns the status of the current statement.

Syntax

Usage

The mi_get_result() function provides the statement status for the current statement on the connection that conn references. The current statement is the most recently executed SQL statement sent to the database server on that connection. One of the DataBlade API statement-execution functions sent the statement to the database server: mi_exec(), mi_exec_prepared_statement(), or mi_open_prepared_statement().

The mi_get_result() function classifies SQL statements as follows.

Type of SQL Statement Statement-Status Constant
Statement is a data manipulation language (DML) statement (DELETE, INSERT, UPDATE) MI_DML
Statement is a data definition language (DDL) statement (such as ALTER TABLE, CREATE TABLE, or DROP TABLE) MI_DDL
Statement produced rows of data that the DataBlade API program must fetch (SELECT or EXECUTE FUNCTION) MI_ROWS, MI_DML

The mi_get_result() function is typically executed in a loop that terminates when this function returns MI_NO_MORE_RESULTS. If mi_get_result() returns MI_ROWS, a query has executed and a cursor is ready to be accessed by the mi_next_row() function.

Return Values

MI_NO_MORE_RESULTS indicates no more results pending.
MI_ROWS indicates that the query has executed successfully and the cursor is available.
MI_DML indicates that a Data Manipulation Language (DML) statement has completed.
MI_DDL indicates that a Data Definition Language (DDL) statement has completed.
MI_ERROR indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_exec(), mi_exec_prepared_statement(), mi_fetch_statement(), mi_next_row(), mi_open_prepared_statement(), mi_result_command_name(), and mi_result_row_count().

For more information about obtaining results, see Processing Statement Results.


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