How to prevent the insertion of duplicate entries in DB2 tables.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Himanshu85
    New Member
    • May 2010
    • 1

    How to prevent the insertion of duplicate entries in DB2 tables.

    Hi,

    There is an issue in our application where we have several duplciate entries present in our DB2 tables due to which the re-org is abending on daily basis. the DBA team has advised us to manually take the unload of the affected tables, indentify the duplicates and then upload them again. But this a manual process and would not also gaurantee if next time if new duplcates are inserted. We tried to give the below combination in the load card:

    LOAD DATA RESUME YES
    INDEX UPDATE
    UNIQUECHECK NO
    ORDER YES

    But the job abended saying invalid combination

    "'INDEX UPDATE' REQUIRES 'UNIQUECHECK NO'"

    We kept the UNIQUECHECK option as "Y" since this would prevent the insertion of new duplicate rows.

    Also one more way we are tyring here is to chnage from LOAD RESUME to LOAD REPLACE, but this would compare the load and the table and then replace it, but what about the duplicates which are already present in the table. How to get rid of them? Can anyone please suggest a way where the duplcate inserts can be prevented in the first place?
Working...