2.2.3.14.3.3 adtgTableDescriptor
The adtgTableDescriptor element specifies a base table on the server that is related to the RecordSet as follows: either the data in the RecordSet was extracted from the base table, or the base table is being updated by applying the data in the RecordSet.
There is one adtgTableDescriptor element for each base table. An adtgTableDescriptor element contains details about a table that is related to a RecordSet, whereas an adtgResultDescriptor element contains details about the RecordSet itself.
The syntax of an adtgTableDescriptor element is defined as follows.
-
adtgTableDescriptor = adtgTokenTableDescriptor adtgTokenTableDescriptorSize TableOrdinal OriginalTableName UpdateTableName CodePage ColumnCount KeyColumnInfo adtgTokenTableDescriptor = %x05 adtgTokenTableDescriptorSize = USHORT TableOrdinal = USHORT OriginalTableName = LENGTH-PREFIXED-STRING UpdateTableName = LENGTH-PREFIXED-STRING CodePage = USHORT ColumnCount = USHORT KeyColumnInfo = KeyColumnCount *KeyColumnOrdinal KeyColumnCount = USHORT KeyColumnOrdinal = USHORT
The fields of this element have the following lengths, types, and meanings:
adtgTokenTableDescriptor
Length: 1 byte
Identifies this component as an adtgTableDescriptor element. The value MUST be set to 0x05.
adtgTokenTableDescriptorSize
Length: 2 bytes
Datatype: USHORT
Specifies the size, in bytes, of the remainder of the adtgTableDescriptor element. This value is equal to the total size of the adtgTableDescriptor element, less the size of the adtgTokenTableDescriptor field (1 byte) and the size of the adtgTokenTableDescriptorSize field (2 bytes).
TableOrdinal
Length: 2 bytes
Datatype: USHORT
Contains the ordinal number of the table, relative to other base tables related to the same RecordSet.
OriginalTableName
Length: Variable
Datatype: LENGTH-PREFIXED-STRING
Specifies the name of the base table from which the data was extracted. For more information about the LENGTH-PREFIXED-STRING type, see section 2.2.1.1.
UpdateTableName
Length: Variable
Datatype: LENGTH-PREFIXED-STRING
Specifies the name of the base table to which updates MUST be sent. For more information about the LENGTH-PREFIXED-STRING type, see section 2.2.1.1.
CodePage
Length: 2 bytes
Datatype: USHORT
Reserved. MUST be set to 0 and ignored on receipt.
ColumnCount
Length: 2 bytes
Datatype: USHORT
Specifies the number of columns from the base table that are in the RecordSet.
KeyColumnInfo
Length: Variable
Specifies the number of columns that make up the table's primary key and the ordinals of those columns.
The KeyColumnInfo field contains exactly one KeyColumnCount member and zero or more KeyColumnOrdinal members. The number of KeyColumnOrdinal members is equal to the value of KeyColumnCount.
The KeyColumnOrdinal members MUST be transmitted in the order of their column ordinal positions in the base table. For example, if columns 3 and 5 of a base table form its key, then the first KeyColumnOrdinal member refers to column 3, and the second KeyColumnOrdinal member to column 5. If KeyColumnCount is 0, then no KeyColumnOrdinal values are written to the wire.
KeyColumnCount
Length: 2 bytes
Datatype: USHORT
Specifies the number of columns that make up the table's primary key. The number of KeyColumnOrdinal members is equal to the value of KeyColumnCount.
If a table has no primary key, then KeyColumnCount is set to zero.
KeyColumnOrdinal
Length: 2 bytes
Datatype: USHORT
Specifies the ordinal number of a column that is part of the table's primary key. The ordinal number of a column MUST match the ordinal number in the BaseTableOrdinal of an adtgColumnDescriptorChild element or an adtgColumnDescriptorParent element.