SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
C-157
CREATE TABLE Statement
DEFAULT default | NO DEFAULT
specifies a default value for the column or specifies that the column does not have
a default value. default can be a literal of one of the special values CURRENT,
SYSTEM, or NULL. For information, see DEFAULT Clause on page D-26.
You must specify the DEFAULT clause if you specify the NOT NULL clause
because the default is DEFAULT NULL.
NOT NULL
specifies that the column cannot contain any null values. SQL allows null values in
a column unless you specify NOT NULL.
If you specify NOT NULL and NO DEFAULT, you must supply a value for the
column in each row inserted. You cannot specify NOT NULL if you also specify
DEFAULT NULL, either explicitly or by default.
HEADING string | NO HEADING
specifies a default heading for the column or specifies that the column has no
default heading.
If you omit this clause, the default heading is the column name.
For more information, see HEADING Clause on page H-1.
[ PRIMARY ] KEY key-column-list
specifies the set of columns that make up the primary key for a key-sequenced
table. Each column in the set must be a column previously defined for the table.
The columns do not need to be contiguous, but their combined length cannot
exceed 255 bytes.
SQL stores and retrieves rows in ascending or descending order, as specified, for
the first column in the list. If multiple rows have the same value in the first column,
SQL uses values in the second column to determine the order. If those are the
same, SQL uses the third column, and so on.
You can specify only one primary key (or one clustering key) for any particular
key-sequenced table. If you do not specify either the PRIMARY KEY clause or
CLUSTERING KEY clause for a key-sequenced table, SQL adds a SYSKEY
column to the table to use as the primary key.
Columns in the primary key definition cannot be updated and cannot contain null
values, even if you omit the NOT NULL clause in the column definition.
For more information, see Primary Keys on page P-27, Syskeys on page S-90, or
Clustering Keys on page C-28.
CATALOG catalog
specifies the catalog to hold the description of the table. The catalog and the table
must be on the same node. The default is the current default catalog.