Please enable JavaScript to view this site.

ESL Documentation

Level 2 subroutine

Return a parameter marker for a prepared SQL statement.

call EDSDescribeParam(HSTMT_IV, PARM_IV, TYPE_IV, LENGTH_IV, SCALE_IV, NULLABLE_IV ) 

HSTMT_IV An input integer value indicating the statement handle.

PARM_IV An input integer value containing the parameter marker number (starting with 1, in the order the parameters were listed in EDSPrepare).

TYPE_IV An output integer value indicating the SQL data type of the parameter.

LENGTH_IV An output integer value indicating the maximum length of the parameter.

SCALE_IV An output integer value indicating the scale (total number of digits to the right of the decimal point) for the data type of the column as defined in the data source, or zero if not valid for the data type.

NULLABLE_IV An output integer value indicating whether the column allows NULL values, using one of the following: EDS_NO_NULLS–the column does not allow NULL values (this is the default value). EDS_NULLABLE–the column allows NULL values. EDS_NULLABLE_UNKNOWN–the driver cannot determine if a column allows NULL values.

Description

Parameter markers are numbered from left to right in the order in which they appear in the SQL statement.

Return Values

EDSDescribeParam returns EDS_SUCCESS, EDS_SUCCESS_WITH_INFO, EDS_INVALID_HANDLE, or EDS_ERROR.

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

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

S1093

Invalid parameter

The value specified for the argument PARM_IV number was less than 1 or greater than the maximum number of parameters supported by the data source.

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

EDSCancel cancels statement processing.
EDSExecute executes a prepared statement.
EDSSetParam specifies an ESL variable for a parameter in a SQL statement.
EDSPrepare prepares a statement for execution.