skip to main content
IP API Reference for C/C++ : IP API for C/C++ : OASQLIP_execute_stmt
 

OASQLIP_execute_stmt

This function is called to execute both SELECT and non-SELECT prepared statements.
For statements that result in a cursor, the IP executes the statement and opens the cursor to the first row. Return the number of rows selected in the piNumResRows parameter. If the number of rows selected cannot be determined, return -1. Call OASQLIP_close_cursor when all rows have been fetched or when the application closes the statement.
For statements that update data (such as INSERT, UPDATE, and DELETE), the IP executes the statement, returns in piNumResRows the number of rows affected, and returns 0 for the number of columns in the cursor when OASQLIP_get_numcols is called.
Call OASQLIP_close_cursor function only when columns are returned.
int OASQLIP_execute_stmt(
SQLIP_HSTMT sqlip_hstmt,
int64 * piNumResRows)
 
Table 17: Parameters for OASQLIP_ExecuteStmt 
Parameter
Type
Description
INPUT
 
 
sqlip_hstmt
SQLIP_HSTMT
Statement handle.
OUTPUT
 
 
piNumResRows
int64 *
Number of rows in the cursor or the number of rows affected for data modifying query. If the statement results in a cursor and the number of rows in the cursor cannot be determined then return –1.
RETURN
 
 
 
int
OADS_SUCCESS – cursor was opened
OADS_ERROR – error processing the request

See also 

OASQLIP_close_cursor
OASQLIP_get_numcols