(Contents)(Previous)(Next)

ADABAS SQLDA Structure

The values of the parameters are represented by constants which can also be utilized in the program. The meaning of the constants is explained after '::=' (for the values of the constants see Section EXEC SQL INCLUDE <filename>).

SQLDAID

Contains the character string 'SQLDA' and serves to facilitate the finding of the structure in a dump.

SQLMAX

Maximum number of the SQLVAR entries. For the precompiler-generated SQLDA, a value is automatically assigned to SQLMAX. In all the other cases, the user must set SQLMAX to a value. The value must be large enough to provide an SQLVAR entry for each column.

SQLN

Number of SQLVAR entries (input and output parameters) to be assigned. The DESCRIBE statement sets the value.

SQLD

Number of output parameters (the column contents must be placed in a program variable). Columns which may be both input and output parameters are counted here as output parameters. The DESCRIBE statement sets the value.

SQLVAR

One 'SQLVAR' entry will be created in the SQLDA for each parameter according to the sequence in the SQL statement. The default maximum number for SQLDA entries is 300. The user is allowed to define them in a new variable.

Structure of the SQLVAR

ADABAS stores here the following information for each parameter:

COLNAME

For FETCH USING DESCRIPTOR, the name of the column is entered; for all other SQL statements, 'COLUMNx' is entered, with x as a consecutive number (1 to n) for the columns.

COLIO

Indicates whether an input or an output parameter is involved.

0 ::= input parameter

1 ::= output parameter

2 ::= input/output parameter

COLMODE

Indicates whether NULL values are allowed.

0 ::= not allowed

1 ::= allowed

COLTYPE

Supplies the ADABAS type.

0 ::= fixed number

1 ::= float number

2 ::= character

3 ::= byte

4 ::= date

5 ::= time

7 ::= float number

8 ::= timestamp

11 ::= Long

12 ::= Long Byte

15 ::= short integer

16 ::= integer

17 ::= varchar

18 ::= sqlescapechar

19 ::= long

20 ::= long byte

23 ::= boolean

COLLENGTH

Number of total places for numeric columns, otherwise the number of characters. Can be set by the user to the length of the program variables.

COLFRAC

Number of places after the decimal point. For coltype = float_number, this array holds -1. Can be set by the user to the length of the program variables.

HOSTINDICATOR

Contains the indicator value. For input parameters, it can be set, for output parameters, it must be checked, since in the case of a NULL value, the program variable will not be overwritten!

HOSTVARTYPE

Contains the data type designation for the program variable and must be assigned by the user. For the DESCRIBE statement, ADABAS sets this parameter to -1. COLLENGTH and COLFRAC must be changed according to the data type.

0 ::= integer (2 bytes long)

1 ::= integer (4 bytes long)

2 ::= real (4 bytes long)

3 ::= real (8 bytes long)

4 ::= decimal

5 ::= zoned (trailing sign)

6 ::= char-array

15 ::= variable length string

22 ::= zoned (leading sign)

23 ::= zoned (leading sign separate)

24 ::= zoned (trailing sign separate)

HOSTCOLSIZE

For ARRAY statements, the size of program variables must be specified here in bytes.

HOSTVARADDR

Contains the address of the program variable assigned to the parameter. The DESCRIBE statement initializes it to zero; the user must assign the address of the program variable to it. For ARRAY statements, this is the address of the first element.

HOSTINDADDR

For ARRAY statements, the address of the indicator array can be specified here.

COLINFO

Must not be modified, because internal information is stored here that is needed for the conversion of program variables.


(Contents)(Previous)(Next)