OAIP_execute
- Last Updated: May 12, 2026
- 2 minute read
- OpenAccess SDK
- Version 8.1
- Documentation
This function is called with iStmtType set to the operation to perform. The connection handle, statement handle, and search column handle are passed in.
When working row-based mode, the hSearchCol column handle is used to determine if a search condition for a column is passed to the IP. The IP should then use this condition to read only the rows that match the specified index value(s). The search column handle that is passed can be part of a single column index or a multi-column index. If the IP is supporting multi-column indexes, it should call dam_getOptimalIndexAndConditions.
For UPDATE, DELETE, and INSERT statements, the IP should maintain a counter for the number of rows effected and return it through the iNumResRows object that is passed in.
int OAIP_execute(
IP_HDBC hdbc,
DAM_HSTMT hstmt,
int iStmtType,
DAM_HCOL hSearchCol,
int64 * piNumResRows)
Parameters for OAIP_execute
| Parameter | Type | Description |
| IN | ||
| hdbc | IP_HDBC | A pointer to connection information maintained by the IP. |
| hstmt | DAM_HSTMT | A handle to the statement being executed. |
| iStmtType | int | Type of the statement:DAM_SELECT - select DAM_UPDATE - update DAM_INSERT - insert DAM_DELETE - delete DAM_SELECT_FOR_UPDATE - lock selected rows DAM_FETCH - called to process additional rows in the case of a select. DAM_CLOSE - called to close the current select processing. DAM_SET_JOIN_ORDER - called to set the join order if the IP supports JOIN ORDER selection. DAM_START_QUERY - called to mark the beginning of a multiple sub-query execution sequence on the same table. DAM_END_QUERY - called to mark the end of a multiple sub-query execution sequence on the same table. DAM_SET_QUERY_MODE - called to allow the IP to determine whether to work in row-based or SQL pass-through mode. |
| hSearchCol | DAM_HCOL | The handle to the column that has the search list to optimize the IP. If this is non-NULL then it must be used. It is non-NULL if the column has an index on it and the IP has reported that it supports equality and other comparison operators used in the search condition. Use the dam_getOptimalIndexAndConditions function to get the associated search list. This parameter is not applicable when working in SQL pass-through mode. |
| OUT | ||
| piNumResRows | int64 * | Returns the number of rows affected by the operation. |
| RETURN | ||
| int | DAM_SUCCESS - on success DAM_FAILURE - on failure DAM_SUCCESS_WITH_RESULT_PENDING - when the IP is processing partial results sets in cursor mode |