Creating Triggers Using SQL Explorer

To create a trigger:

  1. In the context tree, select the table or table object that you want to add the trigger to.
  2. In the Database Hierarchy menubar, click (New) | Trigger. SQL Explorer opens a query tab and populates it with a skeleton trigger, which looks something like this:
    CREATE TRIGGER HOCKEY_audit_trigger FOR HOCKEY AFTER INSERT AS
        INSERT INTO HOCKEY_audit(NEW_ID, TIME) VALUES (NEW.ID, 'now');
    END_TRIGGER
  3. Modify this as needed and then click Execute in the menubar to save the trigger. To cancel the addition of a trigger, close the tab in which you are defining the trigger.