Collapse/Expand Metaconnector
Use a Collapse/Expand Metaconnector to group or ungroup multiple records, with a common key value, into a single record with multivalue fields. The Collapse/Expand Metaconnector wraps another Connector or Metaconnector and collapses records on Fetch operations. It then expands them on write operations according to user-defined criteria. The Collapse/Expand Metaconnector has no effect on metadata operations; it simply passes through Create, Drop, and Action statements.
Since multiple records are combined into or generated from one record, writeback operations are not available. Writeback operations are simulated with keyed operations. When performing a writeback operation through a Collapse/Expand Metaconnector, make sure to provide the relevant key values.
In all cases, a key must be defined as one or more fields. When producing a result set or fetching data, all fields that are not part of the key are retrieved as multivalue datatypes (binary stream formats text list, number list, and datetime list). There are no multivalue equivalents to binary datatypes. On retrieval of data, records are fetched until the key value changes, and then all values for each field are combined into multivalue data objects. When writing data, the inverse occurs -- multiple write operations are invoked (using an optional additional key field or fields for keyed operations), with the key fields staying constant, and the multivalue fields changing on each operation.
It is crucial to the proper behavior of a Collapse/Expand Metaconnection to ensure that any external result set is properly ordered by the grouping keys. This ordering occurs on exactly equivalent keys only; it is not possible to disregard case, even when the Order Metaconnector is used in combination with the Collapse/Expand Metaconnector. This ordering is accomplished by also using the Order Metaconnector. All records with the same grouping key field values are combined (collapsed) until a different key value is encountered, so if all the equivalent keys are not returned consecutively, the corresponding records will not all be combined.
Connectivity to a Collapse/Expand Metaconnection
There are no connectivity requirements beyond those for the underlying connection to which the Collapse/Expand Metaconnection is connecting. Since there is no external database for the Collapse/Expand Metaconnection itself, there is no connectivity test.