Suppose that you need to define a table where you keep
the forms filled out by applicants. You can create a table using the
distinct type PERSONNEL.APPLICATION_FORM as a column type to contain
the completed forms.
Before you begin
For the list of privileges required to create tables, see
the CREATE TABLE statement.
Procedure
To create a table to contain completed job application
forms:
- Create a distinct type for a job application form.
- Issue the following CREATE TABLE statement:
CREATE TABLE APPLICATIONS
(ID SYSIBM.INTEGER,
NAME VARCHAR (30),
APPLICATION_DATE SYSIBM.DATE,
FORM PERSONNEL.APPLICATION_FORM)
The distinct type name is fully qualified because its qualifier
is not the same as the authorization ID and the default function path
was not changed. Remember that whenever type and function names are
not fully qualified, Db2® searches
through the schemas listed in the current function path and looks
for a type or function name matching the given unqualified name. Because
SYSIBM is always considered (if it was omitted) in the current function
path, you can omit the qualification of built-in data types.