Binary column types
If a database column corresponds to a binary type, your type tree contains additional types so that the binary data can be correctly interpreted. The method used to define binary columns allows a distinction to be made between a NULL column and a binary value of 0.
A category called SizedGroup is added to the tree. This category has an item subtype called Sizeof and group subtypes with the same names as the item types for each binary column.
The following changes are made to the type tree to account for columns representing binary data:
- Two variable length binary items are created as subtypes of the Column type to represent the value of the two binary type columns.
- The Sizeof item is a subtype of the SizedGroup category and is defined as a character integer item.
- Also, as a subtype of the SizedGroup category, two groups given the same name as the binary column type are created, each group including two components. The first component of each group is the Sizeof item; the second, the variable length binary item (either).
- The formats of those group types defined as subtypes of the SizedGroup category are defined in the same way as the
format for the Row group type.
If the type tree has a delimited Row group format, the group types for the binary columns are also defined as delimited groups with the pipe character (|) as an infix delimiter. In this example, the Sizeof component is defined as being required in the component list. However, the binary item type is optional (with a range of 0:1).
You cannot generate a fixed Row group format type tree for a table or query containing variable length binary data.
If the type tree has a fixed Row group format, the group types for the binary columns are also defined as fixed groups. In this situation, both the Sizeof component and the binary item type are required.
- In the group type component list, the Sizeof component has the Sized attribute,
indicating that the Sizeof item contains the size of the
binary item that follows it.
When mapping to a table or view containing binary columns, use the SIZE function to assign the size of the binary data to the Sizeof data item.
- The components for the Row type are the group types under the SizedGroup category for the binary columns.