Consultor Eletrônico



Kbase P46776: How to get as much data out of a record as possible after er
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   08/10/2003
Status: Unverified

GOAL:

How to get as much data out of a record as possible after error (450).

GOAL:

SYSTEM ERROR: Cannot read field <field-num> from record, not enough fields. (450)

FIX:

You need to use a field list to sequentially get each field prior to the corrupt one/s.

You first need to get a list of the fields and the order in which they are stored within the database. You can do that using the code below. First replace "yourtablename" with the failing table:

FIND _file WHERE _file._file-name = "yourtablename".

FOR EACH _field OF _file BY _field._field-physpos.
DISPLAY _field._field-name
_field._field-physpos.
END.


You can then use the following code to dump all fields prior to the field that is corrupt.

1. Replace "12345" with the appropriate recid of the record that is failing.
2. Replace "yourtablename" with your failing table.
3. Replace yourfield_1-4 with the appropriate fields from the previous code output. e.g. All fields that are not corrupt:

DEF VAR myrecid AS INT NO-UNDO INIT 12345.
OUTPUT TO VALUE(string(myrecid) + ".txt").
FOR EACH yourtablename FIELDS (
yourfield_1
yourfield_2
yourfield_3
yourfield_4
) WHERE RECID(yourtablename) = myrecid:

PUT UNFORMATTED
"yourfield_1 = " STRING(yourfield_1) chr(10)
"yourfield_2 = " STRING(yourfield_2) chr(10)
"yourfield_3 = " STRING(yourfield_3) chr(10)
"yourfield_4 = " STRING(yourfield_4) chr(10).
END.