|
When defining a trigger, you can specify the trigger timing as whether the trigger action is to be executed before or after the triggering statement. BEFORE and AFTER apply to both statement and row triggers.
Before Triggers
Before triggers are combined with DML statements (Insert /Update/Delete) to construct the triggering condition for a table. For example, the following query updates a table called audit before any changes/ insertions are made to the school table. create trigger Trigger_Name
BEFORE triggers execute the trigger action before the triggering statement is executed. This type of trigger is commonly used in the following situations:
After Triggers AFTER triggers execute the trigger action after the triggering statement is executed. AFTER triggers are used in the following situations:
The following examples depict the usage and syntax for triggers in Daffodil DB. You can create a trigger on the Daffodil DB sample database table with the help of following statement:
create trigger sample_trigger
You can delete an existing trigger on the Daffodil DB sample database table with the help of the following statement. drop trigger sample_trigger For more information and support regarding any issue related to Daffodil DB Contact us at support@daffodildb.com |
