Consultor Eletrônico



Kbase 38637: Error 1422 when trying to update a given record Progress 8.2x
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/17/2000
Solution ID: P8637

FACT(s) (Environment):

Progress 8.2x

SYMPTOM(s):

Error 1422 when trying to update a given record.

SYSTEM ERROR: Index in for recid could not be deleted. (1422)

Error 1422 occurred before on the same index and was fixed with proutil -C idxfix and/or proutil -C idxbuild.

Error 1422 resurfaces now despite of the previous fix with idxfix and/or idxbuild.

Application uses user-defined functions

CAUSE:

Assigning a key field in any statement before a reference to a user-defined function in that same statement has been found to cause index corruption or give run-time error messages.

This applies to any statement that can have multiple assignments in the same statement (e.g. ASSIGN, SET, UPDATE, IMPORT, PROMPT-FOR, CHOOSE).

The following example using the Order and Order-Line tables of the sports database illustrates this:

   ASSIGN order-line.order-num = order.order-num
          order-line.backorder = myFunction().


FIX:

To avoid this situation, either:

1) Move all key field assignments after all user-defined function references in the ASSIGN statement:

   ASSIGN order-line.backorder = myFunction()
          order-line.order-num = order.order-num.

2) Do all key field assignments in a separate ASSIGN statement:

   ASSIGN order-line.order-num = order.order-num.
   ASSIGN order-line.backorder = myFunction().