Consultor Eletrônico



Kbase P119243: RETURN NEXT-VALUE from a method that returns an integer = Error 2782
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/12/2008
Status: Verified

SYMPTOM(s):

Defined method in class which returns integer value

Code inside method does a return next-value(some_sequence)

RETURN statement in user defined function or method 'X' is not type compatible with the function or method definition. (2782)

RETURN statement in user defined function or method '<name>' is not type compatible with the function or method definition. (2782)

code compiled previously in OpenEdge 10.1A

FACT(s) (Environment):

OpenEdge 10.1B
All Supported Operating Systems

CAUSE:

Methods that compiled previously in OpenEdge 10.x may not compile in 10.1B. To accomodate one the OpenEdge 10.1B features, where database sequences are no longer limited to 2GB, the NEXT-VALUE function is defined to return an INT64 data type instead of an INTEGER data type. Methods are strongly data typed, so the compiler will not allow the return of an INT64 from a method defined to return an INTEGER.

FIX:

One of the following corrective actions in suggested order of preference may be considered:

1.) Change the return value of the method to INT64 (ie the method definition)

2.) Cast the result of NEXT-VALUE to an INTEGER if it is small enough

3.) Use the "-noint64" startup parameter for functions that return INT64
When -noint64 is used, specific built-in functions will be compiled as INTEGER and the INT64 constant will be compiled as DECIMAL. However, if the 4GL source refers to an INT64 variable or field and error will be returned.

Functions changed to return INTEGER by the "-noint64" parameter are:
NEXT-VALUE, DYNAMIC-NEXT-VALUE, CURRENT-VALUE, DYNAMIC-CURRENT-VALUE, SEEK, GET-POINTER-VALUE, ETIME, GET-SIZE and INTERVAL.