Progress
Open Client
Developer’s Guide
Providing Metadata For INPUT TABLE-HANDLE Parameters
For TEMP-TABLE parameters, the proxy calls the
MoveNext()
andGetValue()
methods on theProTempTable
to get the data that needs to be passed to the AppServer methods. The metadata is already build into the proxy. For a TABLE-HANDLE parameter, the proxy must first get the metadata from theDataSource
object in theProTempTable
. Then the proxy calls theMoveNext()
andGetValue()
methods on theProTempTable
to get the data that needs to be passed to the AppServer methods. You can provide the metadata in one of the following ways:
- Using a DAO or ADO
DataSource
:If the data source is a standard DAO or ADO object, the proxy can obtain the metadata automatically. When the proxy needs the schema information, it asks the DAO or ADO object for it. The DAO or ADO data types obtained from these objects map to Progress data types as shown in Table 7–3 and Table 7–4. Any data type not specified is unsupported.
Table 7–3: Mapping Between Progress and DAO Data Types Progress 4GL Type DAO Type CHARACTER INTEGER DECIMAL LOGICAL DATE RAW
Table 7–4: Mapping Between Progress and ADO Data Types Progress 4GL Type ADO Type CHARACTER INTEGER DECIMAL LOGICAL DATE RAWThis methodology does not support array fields. If the application requires that the resulting server-side TEMP–TABLE have an array field, the application code must provide a mapping between the flattened set of DAO/ADO fields and the array fields of the TEMP–TABLE. You can do this by calling a
ProTempTable
method as follows:
Identifies the array where startFld is the 1-based index of the field in the DAO/ADO object (based on the flattened field model) and len is the length of the array.
You must call this method after the
DataSource
is specified and before the proxy method call. You must call the method once for each array field that exists in the TEMP–TABLE. For example, if the TEMP–TABLE has the following schema, you would call the method twice:
- Using the
IClientTempTableMetaData
interfaceThere is an interface called
IClientTempTableMetaData
inProO4glActiveXLib
. This would be used in conjunction withIClientTempTable
. In other words, if you are passing a TABLE-HANDLE parameter where theDataSource
is anIClientTempTable
object, that same object must also implement theIClientTempTableMetaData
interface. Static TEMP–TABLE parameters can still use an object that only implements theIClientTempTable
interface.This new interface contains four properties that can return the metadata for the input TABLE-HANDLE:
The FldIndex is the 1-based index of the field as defined by the array model.
The proxy requests the
FieldCount
, then theName
,Type
andExtent
for each field before it sends its request to the AppServer. As with TEMP–TABLE data, the metadata information can be obtained in whatever way the application requires.- Using the
CFields
/CField
objects obtained from a previous output TEMP–TABLE parameterIf the input result set is an updated version of a result set that was first obtained from the AppServer through an OUTPUT parameter, the schema obtained on output can be passed in as the schema for the input table. This schema is available from the
CFields
andCField
objects associated withCProTempTable
. You can think of this as an OUTPUT–INPUT TABLE-HANDLE parameter even though it is output from one method call and input through another. This is accomplished by calling another newProTempTable
method:
fields
A
CFields
object that was obtained from aCProTempTable
object. If a null object is passed, this setting is cleared, and some other source of metadata must be supplied.This method must be called after the
DataSource
is specified and before the proxy method call is made. Also, you must make this call even if theCProTempTable
object is the same instance that was used for the original output parameter and from which theCFields
object is obtained.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |