Suppose you have a trigger that is called on an INSERT to a certain table.
If your trigger is using the BEFORE option, the code within the trigger will be executed before the INSERT into the table occurs.
These trigger types are referred to as "Schema-level triggers". Performing conditional actions in triggers (or testing data following modification) is done through accessing the temporary Inserted and Deleted tables. The following functionality in SQL:2003 was previously not implemented in Postgre SQL: Firebird supports multiple row-level, BEFORE or AFTER, INSERT, UPDATE, DELETE (or any combination thereof) triggers per table, where they are always "in addition to" the default table changes, and the order of the triggers relative to each other can be specified where it would otherwise be ambiguous (POSITION clause.) Triggers may also exist on views, where they are always "instead of" triggers, replacing the default updatable view logic.
Row level triggers would execute once for each row that is affected by the UPDATE.
Database-level triggers can help enforce multi-table constraints, or emulate materialized views.
If an exception is raised in a TRANSACTION COMMIT trigger, the changes made by the trigger so far are rolled back and the client application is notified, but the transaction remains active as if COMMIT had never been requested; the client application can continue to make changes and re-request COMMIT.
Before trigger is for checking data and deciding if operation should be permitted.
If exception is thrown from before trigger then operation is aborted and no data are changed.