Progress
Open Client
Developer’s Guide


Comparing the Flat Model and Array Model For Result Set Access

An array field in a Progress TEMP-TABLE can be viewed as a result set 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 Progress handles array fields.

For both Java and ActiveX clients, there are access methods to support both models. These methods access field values and metadata of an output result set.

The following examples use the Java flat model metadata methods getColumnType() and getColumnCount() and the array model methods getFieldProType() and getFieldCount(). For more information on the result set access methods for both Java and ActiveX clients, see "Programming Java Clients," "Using SmartDataObjects From Java Clients," and Programming ActiveX Controller Clients."

These examples illustrate the use of a Progress TEMP-TABLE with three fields in a Java client application, where the second field is an array of 12 elements.

Using the Flat Model

The flat model methods behave like this:

Since all elements of an array field have the same metadata information, getColumnType(2) through getColumnType(13) return the same value.

Using the Array Model

The array model methods behave like this:

In this model, since all elements of an array field have the same metadata information, it is only necessary to pass in the field index (without an array item index) to these metadata methods. For methods that get a field value, each method has an extra parameter to specify an array index. For example, the method to get the value of a field as an object is:

getObject(int fieldNum, int arrayIndex) 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095