----------  Create or Drop Trigger  ----------

The "create trigger" command creates a trigger on a table. 

Syntax:

  create  trigger TRIGGER | before |
                          | after  |

    |              delete                    |
    |              insert                    |
    | update [ of ( ATTR_NAME {, ATTR_NAME}) |
    | select [ of ( ATTR_NAME {, ATTR_NAME}) |

    { ,  |              delete                    | }
         |              insert                    |
         | update [ of ( ATTR_NAME {, ATTR_NAME}) |
         | select [ of ( ATTR_NAME {, ATTR_NAME}) |

    on TABLE [for each row [when CONDITION]]

    execute PROCEDURE_NAME;

  A database trigger is a procedure without parameter which is associated
  with a table. Empress RDBMS automatically executes a trigger when a
  specified SQL statement is issued against the table.

  The trigger can be specified to fire either before the statement/operation
  (INSERT, DELETE, UPDATE) is attempted on a row/record or after the
  operation has been completed.  In the case of the SELECT trigger however,
  it can be specified to fire only after the SELECT operation has been
  completed.

  UPDATE and SELECT statement can specify the corresponding attribute
  lists. If no attribute is specified, it means all attributes of a table.

  The "when CONDITION" is associated with "for each row" option, if
  "for each row" is not assigned in create trigger command, the "when
  CONDITION" cannot be assigned. Once the "when condition" is assigned for
  "for each row" option, only in the case when the accessed row satisfies
  the condition, the trigger will be fired.

  The CONDITION in "when" clause is similar to that in the "where" clause,
  except that all attributes must be in the table associated with the trigger
  and qualified by either "new." or "old.". Subqueries are not supported.

To remove a trigger, "drop trigger" command is used.

Syntax:

     drop trigger TRIGGER;


For further information on display trigger information, enter:

                help display;

For further information on enable/disable trigger or change priority of
trigger(s), enter:

                help alter;

