Structure IIADD_DT_DFN Fields
The fields of the structure IIADD_DT_DFN compose the data type definition. The first five fields specify the name, length, ID of the new data type, its underlying type, and its attributes. These fields are as follows:
dtd_object_type
Contains the value (hex 210) specified by II_O_DATATYPE.
dtd_name
Specifies the name of the new data type. The name must be a character string with a maximum length of 32 bytes. If the string is less than 32 bytes, it must be null terminated. For example, the data type char is specified as 'char\0'.
dtd_id
Specifies the data type identifier. It is a 2-byte integer field. The ID must be a value between the values represented by ADD_LOW_USER and ADD_HIGH_USER, 16384 and 16511 respectively. This field cannot be altered once the data type is in use.
dtd_underlying_id
Specifies the data type ID, used to store large object segments. This field is used only when the II_DT_PERIPHERAL attribute is set.
dtd_attributes
Specifies the attributes of the data type. If none of the attributes are necessary or appropriate, then set this field to II_DT_NOBITS.
Large objects do not have any inherent sort order, cannot be used as keys for tables, and cannot have histograms. To specify the attributes in the dtd_attributes field, use the constants listed here:
II_DT_NOBITS
Indicates that the data type has no specific attributes.
II_DT_NOKEY
Indicates that the data type cannot be specified as a key column in a modify or create index statement.
II_DT_NOSORT
Indicates that the data type cannot be specified as the target of a sort by or order by clause in a query, nor can the DBMS Server sort on this data type during the execution of a query. Data types tagged with this bit may have no inherent sort order. They are simply marked as “different” by the sort comparison routine.
II_DT_NOHISTOGRAM
Indicates that histograms cannot be constructed for this data type.
II_DT_PERIPHERAL
Indicates that the data type is stored outside of the basic table format. This means that the table itself can contain either the full data element or it can contain a “coupon” that can be redeemed later to obtain the actual data type.
The data representing a peripheral data type is always represented by an II_PERIPHERAL structure. This structure represents the union of the II_COUPON structure and a byte stream (an array of 1 byte/char). This data structure also contains a flag indicating whether this is the real thing or the coupon.
II_DT_VARIABLE_LEN
Indicates that the data type can be specified as occurring a maximum number of times. If compressed, only the actual number of occurrences is saved, thereby saving disk storage.
The remaining fields in the IIADD_DT_DFN structure are filled with the addresses of the required routines that manipulate the data type. The Required Routines for Data Type Definition section lists these routines and the common characteristics that they share. The remainder of the chapter describes each routine in detail.
Last modified date: 01/30/2023