(Contents)(Next)

The DATALOAD Statement

The load statement consists of (at least) two specifications, the first beginning with DATALOAD, the second with INFILE.

Example:

DATALOAD TABLE customer

cno 1-4

name 6-15

city 17-36

state 37-38

zip 39-43

INFILE cmaster.data

The DATALOAD specification describes the target table and the assignment of the input fields to the table columns.

The table name is specified in accordance with the SQL conventions. It can also contain a user name as a prefix (e.g., SALES.CUSTOMER).

Input fields can be assigned to table columns in any order. The order does not affect the speed of processing.

Optionally, the keywords KEY and SET can be placed before the column names. They are treated as comments in the DATALOAD statement but facilitate a later change into a DATAUPDATE statement.

The input fields are described by their starting and ending positions in the input record (beginning with 1). The specification of the end position is optional: if it is omitted, the field length defaults to 1.

If no input field has been assigned to a column in the target table, the entire column is set to default during loading. Without an explicit declaration, this is the NULL value. Key and mandatory columns must be specified in the DATALOAD statement.

The name of the source file from which the records are to be loaded is entered after INFILE. Names of external files remain unchanged when being passed to the operating system. If the data is not placed in an extra file but is specified together with the statement, INFILE * is to be indicated. External data may also be read from tape. Further particulars can be found in the platform-specific User Manuals.


(Contents)(Next)