Salesforce

SYSTEM ERROR 1422 or 17630 updating a field that is part of a unique index

« Go Back

Information

 
TitleSYSTEM ERROR 1422 or 17630 updating a field that is part of a unique index
URL Name000041909
Article Number000166016
EnvironmentProduct: OpenEdge
Version: All supported Versions
OS: All supported platforms
Question/Problem Description
Client receives SYSTEM ERROR 1422 when attempting to update a field in a record that is part of a unique index
IDXCHECK results in SYSTEM ERROR 8783 for the same RECID reported in error 1422 
IDXFIX or IDXBUILD report error 132 for the RECID that failed to add the unique index key
Client receives 17630 
when attempting to update a field in a record that is part of a unique index
Client receives 1422 or 17630 when attempting to delete a record.
Client receives 17630 when attempting to delete a record that is part of a unique index

 
Steps to Reproduce
Clarifying Information

 
Error MessageSYSTEM ERROR: Index <index name> in <table> for recid <RECID> could not be deleted. (1422)
SYSTEM ERROR: Index <index number> ( <Table name>, <Index name>): couldn't find key <index key> recid <RECID>. (8783)
** <file-name> already exists with <field/value...>. (132)
Defect Number
Enhancement Number
Cause
The immediate cause is that there are multiple records with the same value for a uniquely indexed field. How those duplicate values made their way into the database remains unclear.  For potential causes refer to Article
Resolution
1.  The first step in this process is to compare the duplicate records to determine if they are truly duplicates or if only the indexed field(s) have duplicate values. To accomplish this task, use the following pseudo ABL code:

Replace the <...> tags with the corresponding values reported in the 1422 error
FOR EACH <Table Name>  WHERE RECID(<Table Name>) = <RECID>:
    DISPLAY RECID(<Table Name>) <Indexed field name>.
END.

The output associated with the <indexed field name> can be used to find the original records RECID:
FOR EACH <Table Name> WHERE <Indexed field name> = <indexed field name value from above> use-index <non-unique index>:
    DISPLAY RECID(<Table Name>) <Indexed field name>.
END.

Now that both RECIDs are known, the following code will output the complete contents of each field in both records. This can be used for comparison to determine if the records are duplicates or if it just the indexed field that has duplicate values:
 
OUTPUT TO dupeRecs.txt.

FOR EACH <Table Name> WHERE RECID(<Table Name>) = <RECID> OR 
   RECID(<Table Name>) = <RECID returned from above code> :
   DISPLAY <Table Name>  with 1 column down with width 128.
END.

OUTPUT CLOSE.

2.   Review the output produced from the above code. 
If the records are not duplicates but just have duplicate indexed field values determine whether to create a new record with the non-indexed values. Regardless, the next step is to delete the duplicate record with the IDXFIX utility. 
 
$   proutil <db name> -C idxfix
Choose Option 6
Enter the RECID and Area Number of that table that was reported in the original 1422 error.
 
Workaround
Notes
Keyword Phrase
Last Modified Date8/24/2021 1:58 PM

Powered by