SQL/MX 3.x Reference Manual (H06.22+, J06.11+)
SQL/MX Statements
HP NonStop SQL/MX Reference Manual—640322-001
2-83
Syntax Description of CREATE TABLE
•
You do not specify a PRIMARY KEY constraint within the CREATE TABLE
statement.
•
The PRIMARY KEY defined in the CREATE TABLE statement is droppable.
In any of these cases, NonStop SQL/MX implements the PRIMARY KEY as a
separate unique index.
In the scenario described by the first bullet, NonStop SQL/MX does not allow the
primary key constraint to have the NOT DROPPABLE clause. A PRIMARY KEY
which is implemented by a separate unique index is always droppable.
Table 2-1 lists the maximum key size with respect to the block size.
CHECK (condition)
is a constraint that specifies a condition that must be satisfied for each row in the
table. See Search Condition on page 6-106.
NonStop SQL/MX checks the condition whenever an operation occurs that might
affect its value. The operation is allowed if the predicate in the condition evaluates
to TRUE or null but prohibited if the predicate evaluates to FALSE.
You cannot refer to the CURRENT_DATE, CURRENT_TIME, or
CURRENT_TIMESTAMP function in a CHECK constraint, and you cannot use
subqueries in a CHECK constraint. CHECK constraints cannot contain
non-ISO88591 string literals.
REFERENCES ref-spec
specifies a references column constraint. The maximum combined length of the
columns for a REFERENCES constraint depends on the block size of the
supporting index. For 4K blocks, the maximum length is 2010 bytes and for 32K
blocks, it is 2048 bytes.
FOREIGN KEY (column-list) REFERENCES ref-spec
is a column or table constraint (respectively) that specifies a referential constraint
for the table, declaring that a column or set of columns (called a foreign key) in
table can contain only values that match those in a column or set of columns in
the table specified in the REFERENCES clause.
Table 2-1. Maximum Key Sizes Available
DP2 block
size
Max key size
without triggers
Max key size available
with triggers Max # of key columns
4096 2010 1994 1024
32768 2048 2032 1024
The actual limit for primary keys, indexes, and clustering keys depends on the key specification, and will be at
most the maximum key size limit.










