Previous Topic: SQLVAR and SQLTYPENext Topic: SQLVAR and VS/COBOL


SQLDA (EXECUTE, FETCH, or OPEN Statement)

For the EXECUTE, FETCH, or OPEN statement, the SQLDA which describes the host variables must contain the following values:

Field

Value Expected or Returned

SQLAID

Not used

SQLABC

Length of the SQLDA, equal to SQLN*44 + 16 (set by CA Datacom/DB)

SQLN

Total number of occurrences of SQLVAR provided in this SQLDA
(set by user, see Determining Number of SQLVAR Entries to Use)

SQLD

Number of host variables described by occurrences of SQLVAR

Note: The fields of each occurrence of SQLVAR must contain the following values.

Field

Field

Value

Data Type

Nulls

Signed

SQLVAR

SQLTYPE

384/385

fixed-length character string

N/Y

N/A

SQLVAR

SQLTYPE

388/389

fixed-length character string

N/Y

N/A

SQLVAR

SQLTYPE

392/393

fixed-length character string

N/Y

N/A

SQLVAR

SQLTYPE

436/437/438/439

numeric (zoned decimal)

N/Y/N/Y

Y/Y/N/N

SQLVAR

SQLTYPE

448/449

varying-length character string

N/Y

N/A

SQLVAR

SQLTYPE

452/453

fixed-length character string

N/Y

N/A

SQLVAR

SQLTYPE

456/457

long, varying-length character string

N/Y

N/A

SQLVAR

SQLTYPE

464/465

varying-length graphic string

N/Y

N/A

SQLVAR

SQLTYPE

468/469

fixed-length graphic string

N/Y

N/A

SQLVAR

SQLTYPE

472/473

long varying-length graphic string

N/Y

N/A

SQLVAR

SQLTYPE

480/481/482/483

floating-point

N/Y/N/Y

Y/Y/N/N

SQLVAR

SQLTYPE

484/485/486/487

decimal (packed decimal)

N/Y/N/Y

Y/Y/N/N

SQLVAR

SQLTYPE

496/497/498/499

large integer

N/Y/N/Y

Y/Y/N/N

SQLVAR

SQLTYPE

500/501/502/503

small integer

N/Y/N/Y

Y/Y/N/N

SQLVAR

SQLTYPE

504/505

COBOL display sign leading separate

N/Y

Y/Y

Defines the external length of a value from the host variable, as shown in the following table.

Field

Field

Data Type

Value

SQLVAR

SQLLEN

VARCHAR

Length attribute in bytes

SQLVAR

SQLLEN

GRAPHIC

Precision (number of double-byte characters)

SQLVAR

SQLLEN

VARGRAPHIC

Precision (max number of double-byte characters)

SQLVAR

SQLLEN

CHARACTER

Length attribute in bytes

SQLVAR

SQLLEN

FLOAT

8 (bytes)

SQLVAR

SQLLEN

INTEGER

4 (bytes)

SQLVAR

SQLLEN

SMALLINT

2 (bytes)

SQLVAR

SQLLEN

DECIMAL

Precision in byte 1, scale in byte 2

SQLVAR

SQLLEN

NUMERIC

Precision in byte 1, scale in byte 2

SQLVAR

SQLLEN

DATE

10 (bytes)

SQLVAR

SQLLEN

TIME

8 (bytes)

SQLVAR

SQLLEN

TIMESTAMP

26 (bytes)