SQL INCLUDE statement

The SQL INCLUDE specifies the SQL table information to be used to generate field definitions. It names the table and gives the location where the field definitions are to be generated.

Read syntax diagramSkip visual syntax diagramSQL INCLUDE(column)LOCATIONstarting-position*+offsetWSHEADINGUPDATENULLABLEFROMowner.&TABLE
Parameters
column
A list of columns to be included. The Easytrieve field names are generated for these columns. If no columns are specified, all columns from the table are included.
LOCATION
The location at which the field definitions are generated.
starting-position
The starting position relative to position one of the record or file.
*
Indicates that the field begins in the next available starting position.
offset
The offset you want to add to the * position. There must be at least one blank between the * and the +.
W, S
Establishes working storage fields.
HEADING
This statement is not supported by Migration Utility. In Easytrieve Plus, it causes remarks in the DBMS system catalog to be used as HEADINGS.
UPDATE
The generated columns are updated. If UPDATE is coded on the FILE statement, all columns in the file are modifiable.
NULLABLE
Causes default indicator fields to be generated for columns that contain NULL. The indicator field is defined as a 2 B 0 field preceding the field being defined. If the column being defined is used as a host variable, then the default indicator is used as the null indicator unless overwritten by coding an indicator variable.

The indicator variable preceded the data portion of the field in storage. This field cannot be directly referenced. The IF NULL statement must be used.

owner
1 to 18-character alphanumeric qualifier
&TABLE
1 to 18-character alphanumeric name.

SQL INCLUDE must precede any other SQL statements and must be coded in the Library Section of the program.

Example
SQL DCLINCL DCLCTXAB

FILE FILEIN1 SQL
 SQL INCLUDE                +
          (CUST_CO_NBR,     +
           CUST_ID,         +
           ACCT_CO_NBR,     +
           ACCT_PRDCT_CD)   +
     LOCATION *             +
     HEADING                +
     UPDATE                 +
     NULLABLE               +
     FROM CUST_B_ACCT_TB

JOB INPUT FILEIN1
SELECT FROM  FILEIN1         +
       WHERE (CUST_ID = 315)
       .
       .
Note: SQL DCLINCL is a required Migration Utility statement.