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

mi_exec_prepared_statement()

The mi_exec_prepared_statement() function sends a prepared statement to the database server for execution.

Syntax

Usage

The mi_exec_prepared_statement() function performs the following tasks:

The mi_exec_prepared_statement() function only sends the statement to the database server; it does not return results to the application. To get results after the execution mi_exec_prepared_statement(), the DataBlade API module must examine the results via a loop with mi_get_result(). However, the control argument of mi_exec_prepared_statement() does determine the control mode for the statement results.

If the prepared statement is a SELECT statement, you can set the data types of the selected columns by setting a pointer to type name for each returned column in the rettypes array. If the pointer is NULL, the type is not modified. It will either be the return type of the column or the type set by a previous mi_exec_prepared_statement() call. You cannot set the return types of subcolumns of columns of a row type.

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_drop_prepared_statement(), mi_exec(), mi_open_prepared_statement(), and mi_prepare().

For more information, see Executing Prepared SQL Statements.


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