Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    1

    Unanswered: sqlldr concatenate fields

    Hello guys,

    Ive got a problem and I dont know if sqlldr can do concatenation. I want to read in a plain text file where the seperator is a semicolon.
    This is the code I am using:

    LOAD DATA
    INFILE F56100c.dat
    APPEND
    INTO TABLE tstdta.F56100C
    (
    Z59SFU13 POSITION(14;21),
    Z59SFU14 FILLER,
    Z59SFU15 POSITION(22;24),
    Z59SFU16 POSITION(2;10),
    Z59SFU17 POSITION(55;59) + POSITION(51;53) + POSITION(47;49) <-- these three fields have to be concatenated
    )

    Please someone help me!

    Thanks in advance,
    Amar Poeran

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    ex: from Oracle documentation:

    LOAD DATA
    INFILE 'sample.dat' "var 6"
    INTO TABLE departments
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    1 (dept_no
    dept_name,
    dept_mgr COLUMN OBJECT
    (name CHAR(30),
    age INTEGER EXTERNAL(5),
    emp_id INTEGER EXTERNAL(5)) )


    HTH
    Gregg

  3. #3
    Join Date
    Jul 2003
    Posts
    2,296
    use concatenation just like in sql*plus

    when using position, you don't need to worry about where fields are teminated/delimited. It is kind of an either/or thing.

    if you want fields 10 through 15 you would use 10:15, don'e use a semi-colon. Besides this, look up the documentation. It has all the answers.


    below using precision
    PHP Code:
    Z59SFU17 POSITION(55:59)||POSITION(51:53)||POSITION(47:49
    i think you could also use
    PHP Code:
    Z59SFU17 POSITION(55:59,51:53,47:49
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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