Please enable JavaScript to view this site.

ESL Documentation

High Level function

Associate columns in a result set with an ESL structure.

EDSStaticBind(HSTMT_IV, STYPE_IV, SDATA_IV) 

HSTMT_IV An output integer value indicating the statement handle.

STYPE_IV An input integer value indicating a pointer to the structure type.

SDATA_IV An input integer value indicating a pointer to the structure variable.

Description

EDSStaticBind calls EDSNumResultCols, EDSDescribeCol, and EDSBindCol and returns the statement handle. Your application must pass the pointer to the structure definition (STYPE_IV) and to the structure itself (SDATA_IV). This can be done in ESL as follows:

integer STYPE_IV integer ErrorLevel_IV 

 

structure EMP is 

 integer Id 

 string Name 

 string Address 

end structure 

 

structure EMP Employee_Struct . . . 

 

copy (handle of EMP) to Stype_IV 

copy EDSStaticBind(HSTMT_IV, Stype_IV, Employee_Struct) to ErrorLevel_IV 

Return Value

EDSSStaticBind returns EDS_SUCCESS, EDS_COL_MISMATCH, EDS_INVALID_HANDLE, EDS_INVALID_TYPE, or EDS_ERROR.

When EDSSetStaticBind 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 EDSStaticBind.

The following table lists possible SQLSTATE values:

SQL

STATE

Error

Description

08S01

Communication link failure

The communication link between the driver and the data source to which the driver was connected failed before the function completed processing.

24000

Invalid cursor state

The statement associated with the statement handle did not return a result set. There were no columns to describe.

IM001

Driver does not support this function

The driver that corresponds 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.

S1002

Invalid column number

The value specified for the argument COLNUM_IV was less than or equal to 0. The value specified for the argument COLNUM_IV was greater than the number of columns in the result set.

S1003

Program type out of range

The argument ETYPE_IV was not a valid data type.

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.

S1009

Invalid argument value

The argument VALUE_IV was a null value.

S1010

Function sequence error

The combination of the call to EDSStaticBind and the preceding function call was invalid. It is valid to call EDSStaticBind only in one of the following sequences: after a call to EDSExecDirect or EDSExecute where the return code is EDS_NEED_DATA, or following a call to EDSPutData. An asynchronously executing function (not this one) was called for the statement handle and was still executing when this function was called.

S1DE0

No data at execution values pending

There were no data at execution parameters defined on the statement handle.

S1T00

. Timeout expired

The timeout period expired before the data source completed processing the parameter value. The timeout period is set through EDSSetStmtOption, EDS_QUERY_TIMEOUT

See Also

EDSBindCol defines an ESL variable for a column in a result set.

EDSDescribeCol retrieves information about a result column.

EDSNumResultCols determines the number of columns in a result set.