skip to main content
Interface Provider API : Reference : OAIP_procedure_dynamic
 

OAIP_procedure_dynamic

This function must be implemented by the IP, if the IP is to support stored procedure calls that return one or more result sets that are defined at runtime. The OpenAccess SDK SQL engine passes stored procedure calls to this function for all stored procedures marked in the schema as supporting results defined at runtime.
Stored procedure calls are invoked using the ODBC stored procedure invocation syntax. The GETSUPPORT function should return true for IP_SUPPORT_PROCEDURE.
int OAIP_procedure_dynamic(
    IP_HDBC hdbc,
    DAM_HSTMT hstmt,
    int        iType,
    int64 * piNumResRows)
Table 24. Parameters for OAIP_procedure_dynamic
Parameter
Type
Description
IN
ip_hdbc
IP_HDBC
The connection handle as defined by the IP.
hstmt
DAM_HSTMT
The statement handle of the currently active statement.
iType
int
The type of operation requested:
DAM_DSP_INIT - Initialize
DAM_DSP_EXECUTE - Execute the stored procedure and return either all rows or the first block of rows from the current result set. If your IP is written to work in cursor mode, then return DAM_SUCCESS_WITH_RESULT_PENDING after returning a block of rows.
DAM_FETCH - Get next set of rows from the current result set. Return DAM_SUCCESS_WITH_RESULT_PENDING when more rows are pending. Return DAM_SUCCESS when completed.
DAM_CLOSE - Cleanup processing of the current result set.
OUT
piNumResRows
int64 *
The number of rows affected by this operation.
RETURN
int
DAM_SUCCESS - on success
DAM_FAILURE - on failure
DAM_SUCCESS_WITH_MORE_RESULT_SETS - more results available.