3.3.5.2.2 Hierarchical RecordSet

One of the key functions of the shape command language in the RDS Transport Protocol is to enable the client application to request multiple tables in a single response. RDS Transport Protocol is primarily focused on allowing clients from remote locations to access and modify data on the server. Batching changes allows the overall number of round trips to be reduced and provides for more efficient ways to manage this type of data.

The Shape command language uses the Append and the Relates To commands to build up hierarchical data. This typically would happen in an in-memory data structure on the server. This hierarchical data structure would then be serialized out as TableGram data stream.

The shape command language can be used to construct simple and complex sets of related tables.

  • Relation Hierarchy: Two source RecordSets, a parent and a child, create the relation hierarchy, and it usually models a one-to-many relationship between the two RecordSets. The definition specifies the relation between the parent and the child by way of an equality predicate between two fields. When a child reference is requested, the child is filtered for the fields that match the corresponding field in the parent, and the resulting chapter or RecordSet is returned.<80>

  • Parameterized Hierarchy: The parameterized hierarchy is similar to the relation hierarchy. The parent RecordSet is static and fetched up front. But the child RecordSet is defined using a parameterized command, having parent fields as command parameters. The parameterized hierarchy is always delivered by way of a parameterized query.

  • Group Hierarchy: This hierarchy requires only one input RecordSet that will become the child of the group hierarchy. The shape provider performs a grouping on this RecordSet and stores the result in a new local RecordSet, the parent of the group hierarchy. The parent has a column to hold the group details for each row. Group hierarchies are static and can be created on top of any other hierarchy.

More samples of using shape command language are included in section 4.<81>

Chapter columns are indicated by having the DBCOLUMNFLAGS_ISCHAPTER bit in their adtgColumnDescriptorCommon element set to 1. The adtgColumnChildRecordSetId field of the RecordSet referenced by a given row is used as the value for the row/column combination. A RecordSet can contain Any Number of chapter columns greater than or equal to 0.