Purpose (problem description)

This page provides assistance with resolving the error:  duplicate key value violates unique constraint "pk_accidacc" when running an analysis.

The analysis may look like this in the analysis log.

ERROR:  duplicate key value violates unique constraint "pk_accidacc".
DETAIL:  Key (idacc)=(9586593) already exists..
CONTEXT:  SQL statement "insert into Acc (IdAcc, IdClr, IdCle, AccTypLo, AccTypHi, AccTypLo2, AccTypHi2, AccKnd, IdPro, Prop).
  select distinct IdAcc, INTERNAL_SOURCE_ID, INTERNAL_TARGET_ID, AccTypLo, AccTypHi, 0, 0, 0, IDPRO, PROP  .
    from TMP_WK_RESACC t.
  where t.STATUS = 'I'.
    and t.LINK_KIND='N'".
PL/pgSQL function amt_f_maj_lnkmain(integer) line 90 at SQL statement.
SQL statement "select AMT_F_MAJ_LNKMAIN (I_IDSESSION)".
PL/pgSQL function amt_f_maj_objmain(integer) line 111 at SQL statement.
SQL statement "select AMT_F_MAJ_OBJMAIN (I_IDSESSION)".
PL/pgSQL function amt_f_maj_kb_obj(integer) line 24 at SQL statement.
SQL statement "select AMT_F_MAJ_KB_OBJ (I_IDSESSION)".
PL/pgSQL function amt_f_maj_kb(integer) line 24 at SQL statement.
SQL statement "select AMT_F_MAJ_KB (I_IDSESSION)".
PL/pgSQL function cache_flushdata(integer) line 40 at SQL statement (Severity 1, Msg No 1).
Observed in CAST Version


Release

Yes/No

8.3(tick)
8.2(tick)
Observed in RDBMS

RDBMS

Yes/No

Oracle Server(error)
Microsoft SQL Server(error)
CSS3(tick)
CSS2(tick)
Step by Step Scenario
  1. Deliver Code
  2. Analyze Code
  3. Error during analysis
Action Plan

This issue has been seen in an Oracle to CSS migration, though there may be other issues that could result in this error as well.

Perform the below actions

  1. Run the following query and perform the remediation if needed:  SQL Queries - CAST Knowledge Base - How to check the status of the idkey generator and repair it
  2. If the above section do not help you contact CAST Technical Support and provide the following Relevant Input to help CAST Technical Support team reproduce and solve your problem.

 

Notes/comments

Ticket # 18865

Related Pages