INFORMIX
DataBlade API Programmer's Manual
Chapter 12: DataBlade API Function Descriptions
Home Contents Index Master Index New Book

mi_exec_prepared_statement()

The mi_exec_prepared_statement() function executes a prepared statement. For SELECT statements, it opens a cursor rather than executing the statement.

Syntax

Usage

The mi_exec_prepared_statement() function binds in the values to the prepared statement.

Any parameters specified in the statement text must be provided in the values, lengths, and nulls arrays. The arrays are indexed from 0. If a parameter is NULL, the entry in the nulls array for that parameter must be 1. Otherwise, the lengths array must contain the length of the data and the values array entry must contain a pointer to the value.

If input is ASCII, the values array points to strings of data. If it is binary, the data is stored in binary form.

If the prepared statement is a SELECT statement, you can set the result types 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 composite type.

If the prepared statement has parameters and is not an INSERT statement, you must supply the types of the parameters.

Return Values

MI_OK

The function was successful.

MI_ERROR

The function was not successful.




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.