Please enable JavaScript to view this site.

ESL Documentation

Level 2 subroutine

Return the number of parameters in a SQL statement.

call EDSNumParams(HSTMT_IV,NUMPARAMS_IV) 

HSTMT_IV An input integer value that indicates the statement handle.

NUMPARAMS_IV An output integer value indicating the number of parameters in the statement.

Description

EDSNumParams can only be called after EDSPrepare has been called. So for a prepared statement, call EDSNumParams after EDSPrepare and before EDSExecute.

If the statement associated with the statement handle does not contain parameters, EDSNumParams sets NUMPARAMS_IV to zero.

Return Values

EDSNumParams returns EDS_SUCCESS, EDS_ERROR, or EDS_INVALID_HANDLE.

When EDSNumParams 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 EDSNumParams.

The following table lists possible SQLSTATE values:

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.

S1008

Operation cancelled

Asynchronous processing was enabled for the statement handle. The function was called and before it completed execution, EDSCancel was called on the statement handle. Then the function was called again on the statement handle.

S1010

Function sequence error

The function was called prior to calling EDSPrepare for the statement handle. An asynchronously executing function (not this one) was called for the statement handle and was still executing when this function was called.

S1T00

Timeout expired.

The timeout period expired before the data source returned the result set. The timeout period is set through EDSSetStmtOption, EDS_QUERY_TIMEOUT

See Also

EDSSetParam allocates an ESL variable for a parameter.