Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    1

    Unanswered: Flat File Records into Fixed Length Table Field

    Hi,
    I have been asked to use SQL Loader to process a bank file into an Oracle table.

    The request involves taking each line of the file and placing it in a fixed length field on the table.

    If this field is set to 4000 chars for example, is there any likely issues if the data going into it is smaller.

    Please excuse my ignorance as I am just leanring about Oracle.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Wink

    1) Create the target table:

    SQL> Create Table TestTab(id number(7), data varchar2(4000));

    2) With a text editor create the sql-loader control file:

    -- testtab.ctl
    LOAD DATA
    INFILE 'C:\temp\test.dat'
    INSERT INTO TABLE TestTab
    (id SEQUENCE
    ,data POSITION(1:4000))

    3) Load the data:

    sqlldr <uid>/<pw> control=testtab.ctl

    NOTE: No issues if data is smaller than 4000 characters.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •