IBM Support

"SQL0803N One or more values in the INSERT statement ... not valid because the primary key ... from having duplicate values for the index key. SQLSTATE=23505" when trying to import data from flat file

Troubleshooting


Problem

User tries to import data from flat file (CSV). An error appears. This used to work OK in the past. Neither the data file (CSV/TXT) nor the import spec has changed (since it last worked OK).

Symptom

Example #1
Standard Error
Source: System.Web.Services
Description: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: [DB2/NT64] 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 "2" constrains table "<username>.XDB16" from having duplicate values for the index key. SQLSTATE=23505
at Microsoft.VisualBasic.ErrObject.Raise(Int32 Number, Object Source, Object Description, Object HelpFile, Object HelpContext)
at ControllerServerCommon.RaiseErrSrv.RaiseException(Int32 number,
Exception ex)
at FrDImportBT.clsExtImport.DoImport(String sGuid, String sUser, Boolean bCaseExpVal, Int32 lBatchId, String sSpecName, String sStructureType, String sPrompts, Int32 lLLocale, Boolean& bError, Int32& lError, String& sErrorMsg, RecordSet rsFileDataAndInfo, RecordSet& rsRecon, RecordSet& rsLog, Boolean bIsExcelImport, Int64& lImportedRows)
at Cognos.Controller.Proxy.CCRWS.clsExtImport_DoImport(String sGuid,
String sUser, Boolean bCaseExpVal, Int32 iBatchId, String sSpecName,
String sStructureType, String sPrompts, Int32 iLLocale, Boolean&
bError, Int32& iError, String& sErrorMsg, DataSet dsFileDataAndInfo,
DataSet& dsRecon, DataSet& dsLog, Boolean bIsExcelImport)

Example #2
Source: System.Web.Services
Description: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: [DB2/NT64] 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 "6" constrains table "FASTNET.XDB18" from having duplicate values for the index key. SQLSTATE=23505
at Microsoft.VisualBasic.ErrObject.Raise(Int32 Number, Object Source, Object Description, Object HelpFile, Object HelpContext)
at ControllerServerCommon.RaiseErrSrv.RaiseException(Int32 number, Exception ex)
at FrDImportBT.clsExtImport.DoImport(String sGuid, String sUser,
Boolean bCaseExpVal, Int32 lBatchId, String sSpecName, String sStructureType, String sPrompts, Int32 lLLocale, Boolean& bError, Int32& lError, String& sErrorMsg, RecordSet rsFileDataAndInfo,
RecordSet& rsRecon, RecordSet& rsLog, Boolean bIsExcelImport, Int64& lImportedRows)
at Cognos.Controller.Proxy.CCRWS.clsExtImport_DoImport(String sGuid, String sUser, Boolean bCaseExpVal, Int32 iBatchId, String sSpecName, String sStructureType, String sPrompts, Int32 iLLocale, Boolean& bError, Int32& iError, String& sErrorMsg, DataSet dsFileDataAndInfo, DataSet& dsRecon, DataSet& dsLog, Boolean bIsExcelImport)

[{"Product":{"code":"SS9S6B","label":"IBM Cognos Controller"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Controller","Platform":[{"code":"PF033","label":"Windows"}],"Version":"10.2.1","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}},{"Product":{"code":"SSMRTZ","label":"IBM Cognos Controller on Cloud"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
22 June 2026

UID

swg22015404