Level 2 subroutine
Specify multiple values for EDSSetParam parameters.
call EDSParamOptions(HSTMT_IV, CROW_IV, IROW_IV)
•HSTMT_IV An input integer value that indicates the statement handle.
•CROW_IV An input integer indicating the number of values for each parameter. If greater than 1, the VALUE argument in EDSSetParam points to an array of parameter values.
•IROW_IV An output integer value indicating the index of the current set of parameters at execution time.
Description
EDSParamOptions allows your application to specify multiple values for the set of parameters assigned by EDSSetParam. The ability to specify multiple values for a set of parameters is useful for bulk inserts and other work that requires the data source to process the same SQL statement multiple times with various parameter values. An application can, for example, specify three sets of values for the set of parameters associated with an INSERT statement, and then execute the INSERT statement once to perform the three insert operations.
As a statement executes, EDS sets IROW_IV to the index of the current set of parameter values. If an error occurs during execution of a set of parameter values, execution halts at that set of parameter values and EDSExecute, EDSExecDirect, or EDSParamData return EDS_ERROR. The contents of IROW_IV can be used as follows:
•When EDSParamData returns for more information, your application can access the value in IROW_IV to determine which set of parameters is being executed.
•When EDSExecute or EDSExecDirect returns an error, your application can access the value in IROW_IV to find out which set of parameters failed.
When EDSExecute, EDSExecDirect, EDSParamData, or EDSPutData succeed, the value in IROW_IV is set to CROW_IV - the total number of sets of parameters processed.
Return Value
EDSParamOptions returns EDS_SUCCESS, EDS_INVALID_HANDLE, or EDS_ERROR.
When EDSParamOptions returns EDS_ERROR, you can obtain an associated SQLSTATE value with more specific information by calling EDSError. The following table lists each typical SQLSTATE value and explains each one in the context of the command EDSParamOptions.
SQL STATE |
Error |
Description |
IM001 |
Driver does not support this function |
The driver associated with the statement handle does not support the function. |
S1000 |
General error |
An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by EDSError in the argument ERRORTEXT describes the error and its cause. |
S1001 |
Memory allocation failure |
The driver was unable to allocate the memory required to support execution or completion of the function. |
S1010 |
Function sequence error |
An asynchronously executing function (not this one) was called for the statement handle and was still executing when this function was called. |
S1107 |
Row value out of range |
The value specified for the argument CROW_IV was equal to 0. |
See Also
EDSSetParam assigns an ESL variable for a single parameter marker value in a SQL statement.