SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-78
Syntax Description of CREATE TABLE
DROPPABLE specifies that you can drop the NOT NULL constraint by using
ALTER TABLE at some later time. Dropping NOT NULL requires that you know the
name of the constraint, either by using the CONSTRAINT constraint clause
when the table is created or by using SHOWDDL to display the constraint name.
NOT DROPPABLE specifies that the NOT NULL constraint is permanent. Less
space is required to store a column if the column has a permanent NOT NULL
constraint, and updates and inserts are faster.
If the NOT NULL constraint does not include the [NOT] DROPPABLE clause, the
value of the NOT_NULL_CONSTRAINT_DROPPABLE_OPTION attribute in the
SYSTEM_DEFAULTS table is the default value for [NOT] DROPPABLE. If that
attribute does not exist in the SYSTEM_DEFAULTS table, DROPPABLE is used.
Use the SHOWDDL statement to display the default that was used. See System
Defaults Table on page 10-30.
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 is 255 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