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-135
Considerations for CREATE TRIGGER
By default, using the IMPORT utility to import data to a table causes trigger actions
to be performed. If trigger actions are not required, use the -d option with the
IMPORT utility, which allows triggers to be disabled for the duration of the
operation.
Most of MODIFY’s partition management operations ignore triggers. However, the
REUSE form of MODIFY might return errors on a table with DELETE triggers.
Use PURGEDATA to purge the data of a table that is referenced by a trigger or that
is the subject of a trigger. PURGEDATA supports an option that indicates whether
DELETE triggers on the table are ignored. If they are not ignored and a DELETE
trigger exists, PURGEDATA fails.
BACKUP/RESTORE operations on tables ignore triggers.
The mxexportddl utility handles triggers correctly.
VERIFY operations ignore triggers.
Authorization and Availability Requirements
To create a trigger, you must own the schema where the trigger is defined and the
schema where the subject table of the schema resides and you must have
REFERENCES privileges on the columns used on the referenced table. Otherwise,
you must be the super ID.
Trigger Types
You can create a trigger as a BEFORE or AFTER trigger. When a triggering statement
occurs, the following is the order of execution:
1. BEFORE triggered statements
2. Triggering statement
3. Referential actions
4. AFTER triggered statements
Execution of a statement is considered to be complete only when all cascaded triggers
are complete. When multiple triggers are activated by the same event (that is, a conflict
set), the next trigger from the original conflict set is considered only after the execution
of cascaded triggers of a specific trigger is complete (depth-first execution). Within a
conflict set, the order of execution is by timestamp of creation of the corresponding
trigger. Older triggers are executed first.
Statement triggers and row triggers can participate in the same conflict set and can
cascade each other. Therefore, they can appear intertwined.
Triggers use transition tables or transition variables to access old and new states of the
table or row. Statement triggers use transition tables. Row triggers use transition
variables. The following table summarizes the transition variables that different trigger










