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

mi_open_prepared_statement()

The mi_open_prepared_statement() function sends a prepared statement that is a query to the database server for execution and opens a cursor for the retrieved rows of the query.

Syntax

Usage

The mi_open_prepared_statement() performs the following tasks:

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_open_prepared_statement() call. You cannot set the return types of subcolumns of columns of a complex type.

Once opened, you can set up rows in the cursor for fetching with the mi_fetch_statement() function.

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 a cursor was successfully opened. 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_close_statement(), mi_exec_prepared_statement(), mi_fetch_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