Kbase P83887: Getting error 2087, 1071, and 142 when updating decimal data in the SQL Server Database.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/12/2005 |
|
Status: Unverified
FACT(s) (Environment):
MS SQL DataServer
SYMPTOM(s):
Error 2087, 1071, and 142 when updating decimal data in the SQL Server Database.
The record was updated while you were holding it. (2087)
record was changed since you have read it. (1071)
** Unable to update <filename> Field. (142)
The update procedure is run as soon as the data is inserted into the database without re-fetching the data as follows:
The following code is demonstrate using the sports2000 database.
RUN pcreate.
RUN pupdate.
PROCEDURE pcreate:
CREATE invoice.
ASSIGN
invoice.Customer-Code = "99"
invoice.Item-No = "TEST6"
invoice.Item-cost = 1.1
.
END PROCEDURE.
PROCEDURE pupdate:
ASSIGN
invoice.Item-Class = "C".
END PROCEDURE.
NOTE: The above code works in progress database.
CAUSE:
Bug # 20040504-029
CAUSE:
This issue is fixed in Progress 9.1E and OpenEdge Release 10.0B. This problem is with the comparison of the length of the two decimal values, as a character string such as 1.10 vs. 1.1, not done correctly in the buffer.
FIX:
There are two workarounds exist, and they are:
1. Upgrade to OpenEdge Release 10.0B.
or
2. Re-fetch the data from the database after the first assign as:
RUN pcreate.
RUN pupdate.
PROCEDURE pcreate:
CREATE invoice.
ASSIGN
invoice.Customer-Code = "99"
invoice.Item-No = "TEST6"
invoice.Item-cost = 1.1
.
END PROCEDURE.
PROCEDURE pupdate:
FIND CURRENT invoice NO-LOCK. /* Suppresses the error */
FIND CURRENT invoice EXCLUSIVE-LOCK. /* Suppresses the error */
ASSIGN
invoice.Item-Class = "C".
END PROCEDURE.