You can register, deregister, start or stop a trigger instance through SQL statements, and you can also query all registered triggers through SQL statements.
Triggers have two states: STARTED and STOPPED. You can start or stop a trigger by executing START TRIGGER or STOP TRIGGER. Note that the triggers registered by the CREATE TRIGGER statement are STARTED by default.
The following shows the SQL syntax of how to register a trigger.
CREATE TRIGGER <TRIGGER-NAME> (BEFORE | AFTER) INSERT ON <FULL-PATH> AS <CLASSNAME>
You can also set any number of key-value pair attributes for the trigger through the WITH clause:
CREATE TRIGGER <TRIGGER-NAME> (BEFORE | AFTER) INSERT ON <FULL-PATH> AS <CLASSNAME> WITH ( <KEY-1>=<VALUE-1>, <KEY-2>=<VALUE-2>, ... )
Note that CLASSNAME, KEY and VALUE in key-value pair attributes need to be quoted in single or double quotes.
The following shows the SQL syntax of how to deregister a trigger.
DROP TRIGGER <TRIGGER-NAME>
The following shows the SQL syntax of how to start a trigger.
START TRIGGER <TRIGGER-NAME>
The following shows the SQL syntax of how to stop a trigger.
STOP TRIGGER <TRIGGER-NAME>
SHOW TRIGGERS