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-104
Syntax Description of CREATE TABLE
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.
The two columns or sets of columns must have the same characteristics (data
type, length, scale, precision), and there must be a UNIQUE or PRIMARY KEY
constraint on the column or set of columns specified in the REFERENCES clause.
Without the FOREIGN KEY clause, the foreign key in table is the column being
defined; with the FOREIGN KEY clause, the foreign key is the column or set of
columns specified in the FOREIGN KEY clause.
ref-spec is:
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.










