Results 1 to 5 of 5

Thread: sqlldr

  1. #1
    Join Date
    Aug 2006
    Location
    bangalore
    Posts
    3

    Unanswered: sqlldr

    Hi

    i have file sample.csv i have two column col1,col2 in col2 i have data in varchar i need to load to number datatype column in table
    Code:
    desc table test1
    tcol1 varchar2(5),
    tcol2 number(15,3)
    in csv file i have data
    eg:
    Code:
    col1	col2
    a	9,99,999.10
    b	99,99,999.10
    c	99,99,99,999.10
    d	7,77,666.25
    e	45,123.25
    ctl file

    Code:
    OPTIONS ( SKIP=1)
    LOAD DATA 
    INFILE 'test.csv'
    
    INTO TABLE "TEST1"
    INSERT
    
    FIELDS TERMINATED BY ','
     OPTIONALLY ENCLOSED BY '"' AND '"'
    TRAILING NULLCOLS
    
      (tcol1
    , 
       tcol2
    )
    i need to load this col2 data to tcol2 number datatype column. is it possible in loadder itself.

    thanxs

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >is it possible in loadder itself.
    Yes.

    The data file is NOT a "csv" (comma separated values) file.
    You need to modify the control file to match your data file.
    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
    Aug 2006
    Location
    bangalore
    Posts
    3
    in ctl file where to change

    (tcol1
    ,
    tcol2 to_number (:tcol2.....)
    )

    can any one pls let me know...

    thx

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    When all else fails, you need to learn how to Read The Fine Manual
    SQL*Loader Concepts
    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.

  5. #5
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    I would recommend using an external table, just search this forum for "External Table" and this is just one of many you can find on the web:
    Loading multiple flat files into Oracle database - Dev Shed

Posting Permissions

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