Consultor Eletrônico



Kbase P86707: Source element of a RAW-TRANSFER statement has no record. (4951)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/2/2004
Status: Unverified

FACT(s) (Environment):

Sun Solaris SPARC

FACT(s) (Environment):

Progress 9.1C

SYMPTOM(s):

Source element of a RAW-TRANSFER statement has no record. (4951)

Executing code similar to:

DEFINE VARIABLE r AS RAW NO-UNDO.
DEF TEMP-TABLE tt LIKE customer.

REPEAT:
RAW-TRANSFER Customer TO r.
FIND NEXT customer NO-LOCK.
RAW-TRANSFER r TO tt.
END.

CAUSE:

The above code generates the error on the first iteration because we do not have
anything in the source Customer buffer.

FIX:

The fix for the above code is ensure that source Customer buffer of the RAW-TRANSFER statement does indeed has values in it:

DEFINE VARIABLE r AS RAW NO-UNDO.
DEF TEMP-TABLE tt LIKE customer.

FIND FIRST customer NO-LOCK.
REPEAT:
RAW-TRANSFER Customer TO r.
FIND NEXT customer NO-LOCK.
RAW-TRANSFER r TO tt.
END.

Notice that the following code also generates the error because there is no Customer buffer available:

DEFINE VARIABLE r AS RAW NO-UNDO.
FIND FIRST customer NO-LOCK WHERE custnum = 9999 NO-ERROR.
RAW-TRANSFER Customer TO r.

The fix for this code would to check for the availability of the buffer before trying to run the RAW-TRANSFER statement:

DEFINE VARIABLE r AS RAW NO-UNDO.
FIND FIRST customer NO-LOCK WHERE custnum = 9999 NO-ERROR.
IF AVAILABLE Customer THEN
RAW-TRANSFER Customer TO r.
ELSE
MESSAGE "There is no source buffer for the RAW-TRANSFER Statement"
VIEW-AS ALERT-BOX INFO BUTTONS OK.