Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    7

    Unanswered: SQL0803N One or more ...SQLSTATE=23505,

    I hit with the above error msg...the exact msg is...

    SQL0803N One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "1"
    constrains table "TABLEA" from having duplicate rows for those columns. SQLSTATE=23505

    What puzzle me is that i have look at the loading data and found none of them exists in TABLEA.

    can anyone help ?

    Thks!!!

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Run the following query:

    SELECT INDNAME, INDSCHEMA
    FROM SYSCAT.INDEXES
    WHERE IID = <index-id>
    AND TABSCHEMA = 'schema'
    AND TABNAME = 'table'

    Use the appropriate values for schema and table for your error.
    This will tell you which index is causing the duplicate error. Then
    chack your data closely to locate the duplicates. If you are having problems
    finding the duplicates, load the data into an identical table without any constraints (no PK, indexes, and constraints). Then run a query on that table like: SELECT indcol1,indcol2,...,indcoln,count(*) as qty from newtable group by indcol1,indcol2,...,indcoln order by qty
    where indcol1,indcol2,...,indcoln are all the columns that comprise the index of the first query. This will give you the count of duplicate values of the index (where qty > 1).

    HTH

    Andy

  3. #3
    Join Date
    May 2004
    Posts
    7
    Hi Andy....

    Thanks for the help

Posting Permissions

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