Consultor Eletrônico



Kbase P132427: 4GL/ABL: Error (8826) & (5367) invoking BUFFER-COPY() method with fields missing from FIELDS list.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/19/2008
Status: Unverified

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.x

SYMPTOM(s):

4GL/ABL: Error (8826) & (5367) invoking BUFFER-COPY() method with fields missing from FIELDS list.

Field <field-name> from <file-name> record (recid <RECID>) was missing from FIELDS phrase. (8826)

Couldn't extract field '<field>' from source in a BUFFER-COPY statement. (5367)

Field Balance from Customer record (recid 97) was missing from FIELDS phrase. (8826)

Couldn't extract field 'Address' from source in a BUFFER-COPY statement. (5367)

Executing the following code:
DEFINE VARIABLE hTempTableBufferHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE hTableBufferHandle AS HANDLE NO-UNDO.
DEFINE TEMP-TABLE ttCustomer NO-UNDO
FIELD CustNum LIKE Customer.CustNum
FIELD Country LIKE Customer.Country
FIELD Balance LIKE Customer.Balance.
ASSIGN
hTableBufferHandle = BUFFER Customer:HANDLE
hTempTableBufferHandle = BUFFER ttCustomer:HANDLE.
FOR EACH Customer FIELDS (Customer.CustNum) WHERE Customer.CustNum < 5 NO-LOCK:
CREATE ttCustomer.
hTempTableBufferHandle:BUFFER-COPY(hTableBufferHandle,"Country", "Customer.CustNum,ttCustomer.CustNum,Customer.Balance,ttCustomer.Balance").
END.
FOR EACH ttCustomer:
DISPLAY ttCustomer.
END.

CAUSE:

All target buffer fields that are listed in the copy pairs-list of the BUFFER-COPY() method must be explicitly listed in the FIELDS list of the FOR EACH statement. In the above sample code, the field ttCustomer.Balance is included in the copy pairs-list of the BUFFER-COPY() method but it is missing from the the FIELDS list of the FOR EACH statement as required.

FIX:

Include all target buffer fields that are listed in the the copy pairs-list of the BUFFER-COPY() method in FIELDS list of the FOR EACH statement. For example, to fix the above code, add the missing "Customer.Balance" field to the FIELDS list of the FOR EACH statement. That is change the FOR EACH statement:
FOR EACH Customer FIELDS (Customer.CustNum) WHERE Customer.CustNum < 5 NO-LOCK:
CREATE ttCustomer.
hTempTableBufferHandle:BUFFER-COPY(hTableBufferHandle,"Country", "Customer.CustNum,ttCustomer.CustNum,Customer.Balance,ttCustomer.Balance").
END.
To:
FOR EACH Customer FIELDS (Customer.CustNum Customer.Balance) WHERE Customer.CustNum < 5 NO-LOCK:
CREATE ttCustomer.
hTempTableBufferHandle:BUFFER-COPY(hTableBufferHandle,"Country", "Customer.CustNum,ttCustomer.CustNum,Customer.Balance,ttCustomer.Balance").
END.