Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    Chennai, India
    Posts
    18

    Unanswered: Loading Fixed length data

    Hi,

    I am trying to use SQL Loader to load data from text file that is of fixed length. This is the control file that I use.

    LOAD DATA
    INFILE 'D:\VALID1.TXT'
    BADFILE 'D:\VALID1.BAD'
    DISCARDFILE 'D:\VALID1.DSC'
    DISCARDMAX 10
    INSERT
    INTO TABLE VALID
    (
    COMP_PLAN_TITLE POSITION(1:50) VARCHAR,
    COMP_RATE POSITION(51:100) VARCHAR,
    BONUS_RATE POSITION(101:150) VARCHAR,
    IB_SPLIT POSITION(151:200) VARCHAR
    )

    When I tried to load, position that I have mentioned is taken in terms of bytes i.e., say Comp_plan_title 50 bytes and so on.

    Is there any way that i can explicitly say that it is mere position and not bytes.

    Any help would be highly appreciated.
    Palaniappan.S
    Chennai.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Just an idea ... what happens if you substitute VARCHAR with CHAR in control file? For example,

    COMP_PLAN_TITLE POSITION(1:50) CHAR

  3. #3
    Join Date
    Mar 2004
    Location
    Chennai, India
    Posts
    18
    It worked !!!. Thanks for the suggestion.
    Palaniappan.S
    Chennai.

Posting Permissions

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