Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006

    Unanswered: Error: Could not insert new row - duplicate value in a UNIQUE INDEX column

    I'm trying to set up a script which loads an informix table that I will
    use in my Access report.

    I will be loading new customers into it based on transaction date. But
    users can have more than one day's transaction, if I load a bunch of
    people yesterday and a few of them also have a transaction today, I get
    that error, and the processing stops even if most of today's customers
    are not there already. How do I get Informix to just ignore the Index
    Violation and then continue? What I want is one row per customer
    during the current fiscal year which will be deleted at the start of
    the new fiscal year and updated to 0 at the start of a new month.

    The table that I'm loading customers into has fields for sales this
    year, sales this month and yesterday's sales. I want to load new
    customers, but if a customer is already in the table, I want it to add
    yesterday to the fiscal year total and the fiscal month total.
    Otherwise, getting the totals takes forever.

    If I try not exists or not in, it is pretty slow.

  2. #2
    Join Date
    Aug 2003
    I think that you should revise the logic of the process and if finds an existing client, that rewrite the row instead of inserting it.
    Or, change the process, and use temporary table before, then filter this rows.


  3. #3
    Join Date
    Dec 2003
    North America
    You could also review the schema of the index and do one of these two actions:
    (1) add an additional column(s) to the index to preserve uniqueness of the index (preferred)

    (2) make the index non-unique so duplicates (according to the index schema) will be allowed

Posting Permissions

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