Loading from a Fixed Text File

A fixed text file is one in which data resides in fixed positions within the file.

About this task

The following SQL statements load data from the emp_exp external table to a fixed-position table (employee):
CREATE EXTERNAL TABLE emp_ext 
   ( name CHAR(18) EXTERNAL CHAR(18), 
     hiredate DATE EXTERNAL CHAR(10), 
     address VARCHAR(40) EXTERNAL CHAR(40), 
     empno INTEGER EXTERNAL CHAR(6) ) 
USING (
   FORMAT 'FIXED',
    DATAFILES ("DISK:/work2/mydir/emp.fix")
    );
INSERT INTO employee SELECT * FROM emp_ext;

The enumerated columns use the keyword EXTERNAL to describe the format in which to store the data in the external file.