ct_dynsqlda

Description

Operate on a SQLDA structure.

Syntax

CS_RETCODE ct_dynsqlda(cmd, sqlda_type, dap, operation)
 
 CS_COMMAND    *cmd;
 CS_INT                 sqlda_type;
 SQLDA                  *dap;
 CS_INT                 operation;

Parameters

cmd

A pointer to a CS_COMMAND structure.

sqlda_type

Symbolic constant describing the type of SQLDA structure pointed at by dap. In this version, sqlda_type must be CS_SQLDA_SYBASE to indicate a Sybase-style SQLDA structure.

dap

The address of a SQLDA structure. The SQLDA structure is defined in the Sybase sqlda.h header file. See “Sybase-style SQLDA structure” for the definition of this structure.

operation

The operation to perform. Table 3-37 summarizes the use of ct_dynsqlda:

Table 3-37: Values for ct_dynsqlda operation parameter

Value of operation

Function

CS_GET_IN

Fills *dap with a description of the input parameters for a prepared dynamic SQL statement.

CS_GET_OUT

Fills *dap with a description of the columns returned by a prepared dynamic SQL statement.

CS_SQLDA_ PARAM

Uses a SQLDA structure to supply input parameters for the execution of a prepared statement.

When executing a prepared dynamic SQL statement, this operation applies the contents of *dap as input parameters.

CS_SQLDA_ BIND

Uses a SQLDA structure to process results from the execution of a prepared statement.

When processing the results returned by the execution of a prepared dynamic SQL statement, this operation binds the contents of *dap to the result columns.

Returns

ct_dynsqlda returns the following values:

Return value

Meaning

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

CS_BUSY

An asynchronous operation is pending for this connection. See “Asynchronous programming”.

Usage


Sybase-style SQLDA structure


Allocating SQLDA structures


Sybase SQLDA: Retrieving input formats


Sybase SQLDA: Retrieving output formats


Sybase SQLDA: Passing command input parameters


Sybase SQLDA: Retrieving results

See also

ct_bind, ct_cursor, ct_describe, ct_dynamic, ct_dyndesc, ct_fetch, ct_param, ct_res_info