DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: sqlloader question

  1. #1
    Join Date
    Jan 2001
    Posts
    642

    sqlloader question

    Hi,

    I have a datafile which is comma delimited. However, some description feild have a comma which is enclosed with "," (double quotes).

    My problem is while loading the data for the field (description fields) which have both comma and also double quotes.

    ex

    EU01,Part001,"This is a part for PC"," print "A","This is a part for PC"," print "A"


    How can I load this data into my staging tables.
    Region
    Partnum
    Descript...


    badrinath
    There is always a better way to do the things.

  2. #2
    Join Date
    Jan 2001
    Posts
    642
    The data is
    EU01,Part001,"This is a part for PC"," print "A"."

    The above is for Region, Partnum and description.

    The description to be loaded should appear as

    "This is a part for PC, Print "A"."

    My earlier posting got messed up while trying to Highlight the description field.


    How should the control file look.
    Current control file is :

    LOAD DATA
    INFILE '/u01/dataload/AP02/AP02-INVT000008.csv'
    BADFILE '/u01/dataload/AP02/log/AP02-INVT000008.bad'
    DISCARDFILE '/u01/dataload/AP02/log/AP02-INVT000008.dis'
    TRUNCATE
    INTO TABLE stg_ap02_inv_master
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    (
    Region_code,
    PRC,
    Part_desc)

    Badrinath
    There is always a better way to do the things.

Posting Permissions

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


Click Here to Expand Forum to Full Width