Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

OASQLIP_execute_stmt

  • Last Updated: May 12, 2026
  • 1 minute read
    • OpenAccess SDK
    • Version 8.1
    • Documentation

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)

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 openedOADS_ERROR – error processing the request

See also

TitleResults for “How to create a CRG?”Also Available inAlert