|
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.
The mi_open_prepared_statement() performs the following tasks:
Data Representation | Control-Flag Value |
---|---|
External (text) representation | None (default) |
Internal (binary) representation | MI_BINARY |
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.
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.
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.