The Database Trigger Editor consists of the following:
Table Owner |
Displays the userid of the owner of the current database table. Click the arrow to the right of this field to display a drop-down list of users. |
Table |
Displays the name of the current database table. Click the arrow to the right of this field to display a drop-down list of table names of the tables owned by the user shown in the Table Owner field. Click a table in the list to select it. The Table list displays only the names of the database tables you have access to. |
Name |
Displays the name of the current database trigger. Click the arrow to the right of this field to display a drop-down list of trigger names for the table shown in the Table field. The Name list displays only the names of the database triggers you have access to. |
Triggering (BEFORE, AFTER, Instead Of) |
Indicates when the trigger body is fired in relation to the triggering statement (e.g., UPDATE, INSERT, or DELETE) being executed. This set of radio buttons correspond to the BEFORE/AFTER options of the SQL command CREATE TRIGGER. |
Statement |
Specifies the type of SQL statement that fires the trigger body. The possible options are UPDATE, INSERT, and DELETE. Click one or more of the check boxes to activate the option. |
Of Columns |
Displays a list of columns for the table selected in the Table field. This list is only active if the UPDATE option is activated in the Statement field. |
Click one or more columns in this list box to specify that the trigger fires only when one of the selected columns is updated. If you want the trigger to fire when any column in the table is updated, do not click any column names in the list. | |
For Each Row |
Specifies whether the trigger is a row trigger or a statement trigger. For Each Row corresponds to the FOR EACH ROW option of the CREATE TRIGGER command. |
Referencing OLD As |
Specifies a correlation name to avoid a name conflict between the correlation name and a table that is named OLD. |
NEW As |
Specifies a correlation name to avoid a name conflict between the correlation name and a table that is named NEW. |
When |
Specifies a Boolean SQL expression in a WHEN clause. If included, the expression in the WHEN clause is evaluated for each row that the trigger affects. If the expression evaluates to TRUE for a row, the trigger body is fired. If the expression evaluates to FALSE or NOT TRUE (i.e., unknown, as with nulls), for a row, the trigger body is not fired. |
Trigger Body |
Is a scrollable, multi-line text box where you can enter and edit a PL/SQL database trigger body. Trigger bodies are PL/SQL blocks that can include SQL and PL/SQL statements. |
New |
Creates a new, unnamed database trigger. |
Save |
Saves the trigger options and compiles the source appearing in the Trigger Body field. Any error messages generated as a result of the compilation will appear in a separate dialog. |
Revert |
Restores the database trigger to its state at the last save or revert operation. If no save or revert operations have occurred, the database trigger is returned to its original state. |
Drop |
Drops the current database trigger from the database, with confirmation. |
Close |
Attempts to close the Database Trigger editor. If any changes have been made but not applied, an alert appears, prompting you to compile or revert the changes or cancel the operation. Once all changes have been compiled or reverted, the Database Trigger editor is closed. |