Oracle SQLLDR fixed width control file
Below is a SQLLDR fixed width control file. The position of the data in the input data file should match the specified position as shown in the control file (fixedwidth.ctl) for the load to be successful. The numeric data in the data file will be typically left padded with zeros for accuracy as shown below. The files are uploaded to predefined database directories for automated load by scripts.


Fixed Width Control File
-- fixedwidth.ctl
LOAD DATA TRUNCATE
INTO inventory_part_lookup
(part_number      POSITION(001-008) CHAR NULLIF part_number = BLANKS,
 part_description POSITION(009-038) CHAR NULLIF part_description = BLANKS,
 uom_code         POSITION(039-044) CHAR NULLIF uom_code = BLANKS,
 qty_on_hand      POSITION(045-056) CHAR NULLIF qty_on_hand = BLANKS,
 unit_cost        POSITION(057-068) CHAR NULLIF unit_cost = BLANKS,
 stocking_cost    POSITION(069-080) CHAR NULLIF stocking_cost = BLANKS,
 last_sold_date   POSITION(081-088) CHAR NULLIF last_sold_date = BLANKS,
 load_status      CONSTANT "I"
)
Fixed Width Data File
0010001A                 Angle Bracket   EA000000000120000000012.500000001500.0020130501
0010002A                    Base Board   EA000000000150000000002.250000000337.5020131109
0010003A               Housing Channel   EA000000000250000000001.450000000362.5020131215
..
..

Oracle registered trademark of Oracle Corporation.

Last Revised On: February 14, 2014

  72942