Kbase P121523: 4GL/ABL: Error (223) referencing a User Defined INTEGER method in the WHERE clause of a FIND stateme
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/2/2008 |
|
Status: Unverified
SYMPTOM(s):
4GL/ABL: Error (223) referencing a user defined INTEGER method in the WHERE clause of a FIND statement.
** Incompatible data types in expression or assignment. (223)
The FIND, FOR EACH and OPEN QUERY statements fail when the WHERE clause references a user defined INTEGER method.
The FIND, FOR EACH and OPEN QUERY statements succeed when the WHERE clause references a user defined INTEGER function (UDF).
The error is generated code similar to the following code example:
CLASS test:
DEFINE PRIVATE TEMP-TABLE ttTest
FIELD KeySeq AS INTEGER
INDEX ttTest IS PRIMARY UNIQUE KeySeq.
CONSTRUCTOR PUBLIC test():
FIND ttTest WHERE ttTest.KeySeq = GetOrigLayer() NO-LOCK NO-ERROR.
END CONSTRUCTOR.
METHOD PUBLIC INTEGER GetOrigLayer():
RETURN 1.
END METHOD.
END CLASS.
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1B
CAUSE:
Bug# OE00136019
FIX:
Upgrade to OpenEdge 10.1B01 or later.
If upgrading to OpenEdge 10.1B01 or later is not feasible, then a workaround is to store the INTEGER value returned by the user defined INTEGER Method in a temporary INTEGER variable and then use that variable in the WHERE clause instead of directly referencing the method as per the following sample workaround:
CLASS test2:
DEFINE VARIABLE iTemp AS INTEGER NO-UNDO.
DEFINE PRIVATE TEMP-TABLE ttTest
FIELD KeySeq AS INTEGER
INDEX ttTest IS PRIMARY UNIQUE KeySeq.
CONSTRUCTOR PUBLIC test2():
iTemp = GetOrigLayer().
FIND ttTest WHERE ttTest.KeySeq = iTemp NO-LOCK NO-ERROR.
END CONSTRUCTOR.
METHOD PUBLIC INTEGER GetOrigLayer():
RETURN 1.
END METHOD.
END CLASS.