Kbase P112608: How to fix a corrupted table template record values?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/2/2008 |
|
Status: Verified
GOAL:
How to fix a corrupted table template record values
GOAL:
Steps to correct a corrupted table template record values
GOAL:
What causes a corrupted table template record values?
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.1C
Progress 9.1D
FIX:
Table template records are read only and can not be programmatically modified. However, due to bug OE00078834 , discovered in Progress 9.1C and fixed in Progress 9.1E and later as well as in OpenEdge 10.0A and late, these records are updatable and subject to corruption by faulty application logic that fetches records by RECID for update. The following steps describe how to fix corrupted field values of a table template record:
1. Identify the corrupted field(s) values in the template record. For example the following code displays the contents of the "Order" table template record:
FIND _File "Order" NO-LOCK NO-ERROR.
FIND Order WHERE RECID(Order) = _file._template.
DISPLAY order.
2. Deactivate any index containing one or more corrupted fields using the Data Dictionary or 4GL. For example, the following code deactivates the "Customer" table index named "custnum":
FIND _File WHERE _File-Name ="Customer" NO-LOCK NO-ERROR.
IF AVAILABLE(_File) THEN DO:
FIND _Index OF _File WHERE _Index-Name = "custnum".
IF AVAILABLE(_index) THEN
_Index._Active = NO.
END.
3. Write Code to fix the corrupted field values of the template record. For example, the following code resets the ShipDate value of the Order table template record to the unknown value ?:
FIND _File "Order" NO-LOCK NO-ERROR.
IF AVAILABLE(_File) THEN DO:
FIND Order WHERE RECID(Order) = _file._template EXCLUSIVE-LOCK NO-ERROR.
IF AVAILABLE(Order) THEN
ASSIGN
Order.ShipDate = ?.
END.
4. Activate the index(es) deactivated in step (2.) above: Using the PROUTIL IDXBUILD utility.