EPUB | CHM | PDF

Trigger Editor

Top Previous Next

Trigger Editor is placed within the Table Editor dialog. It allows you to modify table triggers.

editor-table-trigger

The main element of the editor is the trigger list, which displays all the triggers in the table and their properties. These properties are as follows:

Trigger Name

The name of the trigger. It must be different from any other trigger name of the same table.

Procedure

Select stored procedure from the list of the defined ones within the diagram. This function will be executed when the trigger fires.

For Each

It specifies whether the trigger procedure will be fired once for every row affected by the trigger event, or just once per SQL statement. If neither is specified, then the trigger procedure FOR EACH STATEMENT is the default.

Time

Determines whether the function is called before or after the event.

When

A boolean expression that determines whether the trigger function will actually be executed. If WHEN is specified, the function will only be called if the condition returns true. In FOR EACH ROW triggers, the WHEN condition can refer to columns of the old and/or new row values by writing OLD.column_name or NEW.column_name respectively. Of course, INSERT triggers cannot refer to OLD and DELETE triggers cannot refer to NEW.

note Currently, WHEN expressions cannot contain subqueries.

Events

Indicates the kind of statement that activates the trigger. It can be INSERT, UPDATE, DELETE or TRUNCATE.

note For UPDATE triggers, it is possible to specify a list of columns. The trigger will only fire if at least one of the listed columns is mentioned as a target of the update.

Comment

Defines comment for trigger object.

Generate

Enables trigger creation during Database Generation and Database Modification.

The buttons under the list of triggers allow you to perform the following actions:

§Add - add a new trigger to the end of the list;
§Delete - remove the selected trigger from the list;
§Up/Down - move the selected trigger along the list.

See also:
Table Editor | Triggers