SQL/MX 2.x Installation and Management Guide (H06.10+, J06.03+)

Creating an SQL/MX Database
HP NonStop SQL/MX Installation and Management Guide544536-007
7-41
Creating Triggers
FROM SALES.ODETAIL OD INNER JOIN SALES.PARTS P
ON od.partnum = p.partnum;
Creating Triggers
Use the CREATE TRIGGER statement to create triggers on SQL/MX tables. A trigger
is a mechanism that sets up the database to perform certain actions automatically in
response to the occurrence of specified events. To create a trigger, you must own its
schema or be the super ID user. You must also own the schema where the subject
table resides and have appropriate privileges on the referenced table.
For more information about triggers and the CREATE TRIGGER statement, see the
SQL/MX Reference Manual.
Guidelines on Using Triggers
Do not use triggers on SQL/MX user metadata tables, system metadata tables, or
MXCS metadata tables.
You cannot define triggers on SQL/MP objects. SQL/MP objects cannot be
referenced in a trigger.
Trigger Temporary Tables
When you create the first trigger on a table, NonStop SQL/MX automatically creates
one trigger temporary table for all triggers on that table. The trigger temporary table
stores results that are generated while one of the base table’s triggers is activated.
NonStop SQL/MX drops the trigger temporary table when the last trigger defined on
that table is dropped.
Creating Stored Procedures in Java
Use the CREATE PROCEDURE statement to register an existing Java method as an
SPJ within an SQL/MX database. For information, see the SQL/MX Guide to Stored
Procedures in Java.
Database Design Guidelines for Improving
OLTP Performance
To improve database performance in an online transaction processing (OLTP)
environment, observe these guidelines when you design an SQL/MX database:
Note. The Result Set Support for Stored Procedures in Java is available only on systems
running J06.05 and later J-series RVUs and H06.16 and later H-series RVUs. This feature is
supported by SQL/MX 2.3.2.