A structured type can serve as the type of a table or view in which each column of the table derives its name and data type from one of the attributes of the structured type. A structured type can also serve as a type of a column or a type for an argument to a routine.
CREATE TYPE Person_t AS
(Name VARCHAR(20),
Age INT,
Address Address_t)
INSTANTIABLE
REF USING VARCHAR(13) FOR BIT DATA
MODE DB2SQL;
Unlike distinct types, the attributes
of structured types can be composed of types other than the built-in DB2® data types. The preceding type
declaration includes an attribute called Address whose
source type is another structured type, Address_t.