Try OpenEdge Now
skip to main content
Java Open Clients
Passing Temp-tables as SQL ResultSet Parameters : Preparing and managing temp-table parameters : Accessing temp-table array fields
 

Accessing temp-table array fields

In ABL, fields in a temp-table can be defined with an extent value that creates a one-dimensional array of the specified data type, with the number of elements specified by the extent. JDBC ResultSet objects do not support arrays.
An array field in an ABL temp-table can be viewed as a ResultSet in two different ways. In the flat model, each array element becomes a separate column of the table. In the array model, each array is a single column of the table, with each array element being accessed by an index on the array column. The array model matches how ABL handles array fields.
For Java clients, there are access methods to support both models. These methods access field values and meta data of an output ResultSet.
For input, the proxy assumes the fields use the flat column model. For output, your application can access array fields using either the flat column model or array model. For more information, see Accessing TABLE or TABLE-HANDLE parameters as OUTPUT.
The following examples use the Java flat model meta data methods getColumnType() and getColumnCount() and the array model methods getFieldProType() and getFieldCount(). These examples illustrate the use of a temp-table with three fields in a Java client application, where the second field is an array of 12 elements.
* Using the flat model
* Using the array model