Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Posts
    29

    Unanswered: sqlldr control file

    hello

    I am using a control file to load data in to oracle table

    but how can i modify control file to generate primary key,that means i wanted to write a condition to eliminate duplicates or throw error if i have duplicate value

    options (skip = 1)
    LOAD DATA
    INFILE '\\OHLEWNAS0240\THIDWLOAD\line_cvg_project\linecvg 1.txt'
    BADFILE '\\OHLEWNAS0240\THIDWLOAD\line_cvg_project\linecvg 1.bad'
    DISCARDFILE '\\OHLEWNAS0240\THIDWLOAD\line_cvg_project\linecvg 1.dsc'
    replace
    INTO TABLE DATUSER.LINECVG_LOOKUP
    TRUNCATE
    FIELDS TERMINATED BY ' '
    OPTIONALLY ENCLOSED BY "'"TRAILING NULLCOLS
    (L2COCD "TO_NUMBER(:L2COCD)",
    L2SABB ,
    L2PRCD ,
    L2RRDT "TO_DATE(:L2RRDT,'MM/DD/YYYY')",
    L2CVCD ,
    SSLNCV
    )

    Thanks in advance!!
    Hasya

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >but how can i modify control file to generate primary key,
    If table really does have a Primary Key (PK), then PK does not allow duplicate PK values to be entered.
    So nothing additional needs to be done in the control 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
    Jan 2010
    Posts
    29
    Thanks for your reply anacedent

    But the table don't have primary key,my gola is to load should stop if it finds any duplicate values


    Thanks
    Hasya

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Quote Originally Posted by hasya05 View Post

    But the table don't have primary key,my gola is to load should stop if it finds any duplicate values
    add UNIQUE INDEX for column(s) that define uniqueness
    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
    Jan 2010
    Posts
    29
    other than adding unique index there is no other way that i can check in the control file?

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    you are free to implement anything that meets your requirements
    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.

Posting Permissions

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