(Contents)(Previous)(Next)

Generating Host Variables

A structure can be generated for a table by means of the include statement. This structure may then be used as a host variable. To do so, the option check must be set and the file <filename> must not exist. Then a database session with the predefined user specifications will be opened in order to be able to fetch the corresponding pieces of information from the database and to generate the file <filename>.

The file <filename> contains the structure which was generated from the table. The name of the table (default) or any other name (as clause) may be given to this structure. Another structure may be generated in addition which can be specified as an indicator (ind clause). Component names are derived from a table's column names. The names of the indicator structure are also derived from the table name and column names; they are provided with the prefix 'I'.

If long columns are contained in the table, a character string of 8240 characters is generated as host variable for each long column. The precompiler returns a warning. The programmer can use an editor to insert the desired length or another host variable.

Example:

A table may be defined by:

Then a program may contain the following statements:

The include statement generates the declarations:


(Contents)(Previous)(Next)