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-141
Examples of CREATE TRIGGER
SPJ with resultset is not supported.
AFTER triggers are supported.
You must ensure that there is no recursion between SPJ and trigger tables as it
can cause undefined behavior.
The following example creates a trigger that executes an stored procedure, named
LOWERPRICE defined on page 2-85, when the QTY_ON_HAND column of the
PARTLOC table is updated and exceeds 500 parts. For definition of tables, see
Appendix D, Sample Database.
CREATE TRIGGER sales.setsalesprice
AFTER UPDATE OF qty_on_hand
ON invent.partloc
FOR EACH STATEMENT
REFERENCING NEW as newqty
WHEN ( SUM(newqty.qty_on_hand) > 500 )
CALL sales.lowerprice();










