Try OpenEdge Now
skip to main content
Java Open Clients
Using the Open Client Java OpenAPI to Directly Access the AppServer : Setting up parameters : Arrays as return values : setIsReturnUnknown( ) method
 
setIsReturnUnknown( ) method
This method must be set to TRUE if the return type from a user defined function is an array that can contain the Unknown value (?). Setting the method for scalar return values is not necessary, but it may be a useful convention for code readability.
Syntax
public bool setIsReturnUnknown( boolean bIsReturnUnknown )
For scalar return values, when you call getReturnValue(), the method returns an object. If that object is null, then you know the ABL user-defined function returned the Unknown value (?). If the object is not null, you can then cast it to the proper type object to get the value:
Integer intRetVal = (Integer)parms.getReturnValue(); )
For array return values, if the method is set to FALSE, the default, the Open Client expects a value and maps the return to the data type shown in the second column of the table in Arraysas return values. If the method is TRUE, then the return maps to the alternate data type if one is shown in column three of the table.
For example, if the ABL return type is INTEGER EXTENT and this method is set to TRUE, the getReturnValue() method returns Integer[]. If it is set to FALSE, the method returns int[].
ParamArray parms = new ParamArray(1);
...

// Set up return type
parms.setReturnType (Parameter.PRO_DECIMAL);
parms.setIsReturnExtent (true);

// Run procedure
openPO.RunProc("GetOrderTotalsByDollar", parms);

// Get return value
java.math.BigDecimal [] retValArray = (java.math.BigDecimal [])
                                       parms.getReturnValue();