The SQLDA Header
The fields in the SQLDA header have different usage depending on whether the SQLDA is being used in a DESCRIBE or PREPARE INTO statement or the SQLDA is being used in a FETCH, INSERT, OPEN, EXECUTE, or CALL statement.
The following table describes the fields in the SQLDA header.
| C name
assembler, COBOL or PL/I name |
Data
type |
Usage in DESCRIBE1
and PREPARE INTO |
Usage in FETCH,INSERT, OPEN,
EXECUTE, and CALL |
|---|---|---|---|
| sqldaid
SQLDAID |
CHAR(8) | An eye catcherfor storage dumps, containing the text 'SQLDA '. The 7th byte of the field is a flag that can be used to determine if more than one SQLVAR entry is needed for each column. For details, see Determining how many SQLVAR occurrences are needed. For DESCRIBE CURSOR, the field is set to 'SQLRS'. If the cursor is declared WITH HOLD in a stored procedure, the high-order bit of the 8th byte is set to 1. For DESCRIBE PROCEDURE, it is set to 'SQLPR'. |
A plus sign (+) in the
6th byte indicates that SQLNAME contains an overriding CCSID. A '2' in the 7th byte indicates the two SQLVAR entries were allocated for each column or parameter. A '3' in the 7th byte indicates that three SQLVAR entries were allocated for each column or parameter. Although three entries are never needed on input to Db2, an SQLDA with three entries might be used when the SQLDA was initialized by a DESCRIBE or PREPARE INTO with a USING BOTH clause. Otherwise, SQLDAID is not used. |
| sqldabc
SQLDABC |
INTEGER | Length of the SQLDA,
equal to SQLNx * 44+16. |
Length of the SQLDA,
greater than or equal to SQLNx * 44+16. |
| sqln
SQLN |
SMALLINT | Unchanged by Db2. The field must
be set to a value greater than or equal to zero before the statement
is executed. The field indicates the total number of occurrences of
SQLVAR. At the very least, the number should be:
|
Total number of occurrences of SQLVAR provided in the SQLDA. SQLN must be set to a value greater than or equal to zero. |
| sqld
SQLD |
SMALLINT | The number of columns
described by occurrences of SQLVAR. Double that number if USING BOTH
appears in the DESCRIBE or PREPARE INTO statement. Contains a 0 if
the statement string is not a query. For DESCRIBE PROCEDURE, the number of result sets returned by the stored procedure. Contains a 0 if no result sets are returned. |
The number of host variables described by occurrences of SQLVAR. |
Note:
|
|||