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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-19
Syntax Description of ALTER TABLE
table can contain only values that match those in a column or set of columns
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.
The foreign key is the column or set of columns specified in the FOREIGN KEY
clause, immediately following the FOREIGN KEY keywords.
ref-spec is:
referenced-table [(column-list)]
referenced-table is the table referenced by the foreign key in a referential
constraint. referenced-table cannot be a view, and referenced-table
cannot be the same as table.
column-list specifies the column or set of columns in referenced-table
that corresponds to the foreign key in table. The columns in the column list
associated with REFERENCES must be in the same order as the columns in
the column list associated with FOREIGN KEY. If column-list is omitted, the
referenced table’s PRIMARY KEY columns are the referenced columns.
A table can have an unlimited number of referential constraints and you can
specify the same foreign key in more than one referential constraint, but you must
define each referential constraint separately.
Publish/Subscribe's embedded update and embedded delete statements are not
allowed on tables with referential integrity constraints:
You cannot create self-referencing foreign key constraints. When a foreign key
constraint is added to an existing table, NonStop SQL/MX verifies that the data
does not violate the constraint. If it does, a message is returned indicating the
constraint was not created.
ATTRIBUTE[S] attribute [,attribute ]...
changes the values of file attributes for the table and its dependent indexes. You
can separate attributes with either a space or a comma. File attributes you can
specify are:
ALLOCATE/DEALLOCATE
on page 8-2
Controls amount of disk space allocated.
AUDITCOMPRESS on
page 8-3
Controls whether unchanged columns are included
in audit records.
CLEARONPURGE on
page 8-5
Controls disk erasure when table is dropped.
MAXEXTENTS on
page 8-7
Controls maximum disk space to be allocated.