Results 1 to 3 of 3

Thread: Sql Loader

  1. #1
    Join Date
    Nov 2007
    Posts
    6

    Red face Unanswered: Sql Loader

    LOAD DATA
    INFILE 'new_employees.csv'
    badfile 'new_employees.bad'
    replace
    into table temp_emp
    fields terminated by ","
    trailing nullcols
    (
    LAST_NAME"substr(:last_name,1,20)",
    TITLE,
    FIRST_NAME,
    ADD1 "decode(:add1, null,null,:add1)",
    HOME_TEL "decode(:home_tel, null,null,:home_tel)" ,
    DATE_STARTED
    "decode(:date_started, null, (select sysdate from dual),:date_started)",
    EMP_NO "emp_no_seq.nextval",
    PCODE FILLER
    )

    The address field add1 has commas (,) in it e.g.
    9, The valley blah blah
    how do i get round that and load the whole string without the loader reading
    9, The Valley as two separate fields??
    Thank you

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    If the address field was enclosed in double quote marks, then you could use FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2007
    Posts
    6
    Thank you

Posting Permissions

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