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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-16
Syntax Description of ALTER TABLE
update rule specifies what referential action is taken when
column-list in referenced-table is updated. If no ON UPDATE
clause is specified, a default of ON UPDATE NO ACTION is assumed.
delete rule specifies what referential action is taken when a
row in referenced-table is deleted. If no ON DELETE clause is
specified, a default of ON DELETE NO ACTION is assumed.
referential action
RESTRICT referential action means that the referential check is
made for each row. An error is raised when the referential constraint is
violated.
ANSI SQL-99 standard: NO ACTION referential action means that
the referential check is made at the end of the SQL statement. An error is
raised when the referential constraint is violated.
NonStop SQL/MX does not support NO ACTION referential action in the
way it is specified by ANSI SQL-99. However, you can change NO
ACTION's behavior to be the same as RESTRICT by setting an
appropriate value for the Control Query Default
REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT. Options for this
attribute are:
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.
DROP CONSTRAINT constraint [RESTRICT | CASCADE]
drops a constraint from the table. The constraint name constraint must be
specified. If you did not specify a name when you created the constraint or do not
know the constraint name, you can use SHOWDDL to display it.
A referential constraint is dependent on its referenced column list. This column list
is associated with a UNIQUE or PRIMARY KEY constraint. When a UNIQUE or
PRIMARY KEY constraint is dropped, NonStop SQL/MX checks if any referential
constraints are dependent on the constraint.
If you specify RESTRICT and referential constraints are dependent on the
constraint, you cannot drop the constraint.
OFF SQL issues an error.
SYSTEM SQL issues warning 1302, indicating that it will behave like
RESTRICT. The default is SYSTEM.
ON Makes NO ACTION behave like RESTRICT, without warnings or
errors.