(Contents)(Previous)(Next)

Generating Column Names

A structure name can also be specified as '!var' in the <column list> of an SQL statement. This has the same effect as the explicit specification of the individual components in their order of definition. Instead of the exclamation mark, the character tilde ('~var') may also be used. "<[authid].tablename.>" can also be specified before "!<var>".

If the structure is a record, the name of a <column> is composed of the names of the records of the 2nd to n-th level. These names are appended to each other in the order of their ascending level numbers. They are separated by the underline character ('_').

Example:

01 A.

02 B. =======> B_C

03 C PIC ...

01 A. B_C1_1

02 B. =======> B_C1_2

03 C1 OCCURS 3 TIMES. B_C1_3

03 C2 PIC ... B_C2

The names for the <column> formed in this way must be identical with the column names. If tables are included, the name of the data element containing the OCCURS clause and the index appended to the name are inserted as the column name. The name of the data element with the index as subscript has to be specified as a host variable.

If records are used as table elements, the precompiler runtime system issues array statements to the DBMS. In this case, the number of record components must be identical to the number of columns, and the components must be compatible with the column type.

Example:


(Contents)(Previous)(Next)