SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)
SQL/MX Statements
HP NonStop SQL/MX Release 3.2 Reference Manual—691117-001
2-102
Syntax Description of CREATE TABLE
Use the SHOWDDL statement to display the default that was used. See System
Defaults Table on page 10-38.
UNIQUE
or
UNIQUE (column-list)
is a column or table constraint (respectively) that specifies that the column or set of
columns cannot contain more than one occurrence of the same value or set of
values. If you omit UNIQUE, duplicate values are allowed.
column-list cannot include more than one occurrence of the same column. In
addition, the set of columns you specify on a UNIQUE constraint cannot match the
set of columns on any other UNIQUE constraint for the table or on the PRIMARY
KEY constraint for the table. All columns defined as unique must be specified as
NOT NULL.
The maximum combined length of the columns depends on the block size of the
index that supports the constraint. For 4K blocks, the maximum length is 2010
bytes and for 32K blocks, it is 2048 bytes.
PRIMARY KEY [ASC[ENDING] | DESC[ENDING]] [[NOT] DROPPABLE]
or
PRIMARY KEY (key-column-list) [[NOT] DROPPABLE]
is a column or table constraint (respectively) that specifies a column or set of
columns as the primary key for the table. key-column-list cannot include more
than one occurrence of the same column. In addition, the set of columns you
specify on a PRIMARY KEY constraint cannot match the set of columns on any
UNIQUE constraint for the table.
ASCENDING and DESCENDING specify the direction for entries in one column
within the key. The default is ASCENDING.
The PRIMARY KEY value in each row of the table must be unique within the table.
Columns within a PRIMARY KEY cannot contain nulls. A PRIMARY KEY defined
for a set of columns implies that the column values are unique and not null. You
can specify PRIMARY KEY only once on any CREATE TABLE statement.
DROPPABLE specifies that you can drop the PRIMARY KEY constraint with an
ALTER TABLE statement at some later time. NOT DROPPABLE specifies that the
PRIMARY KEY constraint is permanent. A PRIMARY KEY constraint is
implemented more efficiently if the constraint is permanent. A SYSKEY is not
generated for a table that has a NOT DROPPABLE PRIMARY KEY.
For a NOT DROPPABLE PRIMARY KEY, the maximum combined length of the
columns depends on the block size of the table. For a DROPPABLE PRIMARY
KEY, the maximum combined length of the columns depends on the block size of
the supporting index. For both a DROPPABLE and NOT DROPPABLE PRIMARY
KEYs, the maximum length is 2010 bytes for 4K blocks and 2048 bytes for 32K
blocks.










