Reference types
Db2 uses the reference type as the type of the object identifier column in typed tables. The object identifier uniquely identifies a row object in the typed table hierarchy. Db2 also uses reference types to store references to rows in typed tables. You can use reference types to refer to each row object in the table.
References are strongly typed. Therefore, you must have a way to
use the type in expressions. When you create the root type of a type
hierarchy, you can specify the base type for a reference with the
REF USING clause of the CREATE TYPE statement. The base type for
a reference is called the representation type. If you
do not specify the representation type with the REF USING clause, Db2 uses
the default data type of VARCHAR(16) FOR BIT DATA. The representation
type of the root type is inherited by all its subtypes. The REF USING
clause is only valid when you define the root type of a hierarchy.
In the examples used throughout this section, the representation type
for the BusinessUnit_t type is INTEGER, while the
representation type for Person_t is VARCHAR(13).