home *** CD-ROM | disk | FTP | other *** search
- -- Loads EMP records from first 23 characters
- -- Creates and loads PROJ records for each PROJO listed
- -- for each employee
-
- LOAD DATA
- INFILE CASE5.DAT
- BADFILE CASE5.BAD
- DISCARDFILE CASE5.DIS
- REPLACE
-
- INTO TABLE EMP
- (EMPNO POSITION(1:4) INTEGER EXTERNAL,
- ENAME POSITION(6:15) CHAR,
- DEPTNO POSITION(17:18) CHAR,
- MGR POSITION(20:23) INTEGER EXTERNAL)
-
- INTO TABLE PROJ
- -- PROJ has two columns, both not null: EMPNO and PROJNO
- WHEN PROJNO != ' '
- (EMPNO POSITION(1:4) INTEGER EXTERNAL,
- PROJNO POSITION(25:27) INTEGER EXTERNAL) -- 1st proj
-
- INTO TABLE PROJ
- WHEN PROJNO != ' '
- (EMPNO POSITION(1:4) INTEGER EXTERNAL,
- PROJNO POSITION(29:31) INTEGER EXTERNAL) -- 2nd proj
-
- INTO TABLE PROJ
- WHEN PROJNO != ' '
- (EMPNO POSITION(1:4) INTEGER EXTERNAL,
- PROJNO POSITION(33:35) INTEGER EXTERNAL) -- 3rd proj
-