Nothing Special

Submitted by: Submitted by

Views: 18

Words: 659

Pages: 3

Category: Science and Technology

Date Submitted: 02/24/2015 08:33 PM

Report This Essay

Discussion Thread 1

Title: Types of triggers

There are two types if triggers based on the level of their execution:

Row level triggers: This type of trigger executes when you insert,update or delete a row in a table or a view. A comparison between this two types of triggers can help my understanding. Please feel free to throw more in. Row level triggers: Fire once per row which meets the condition

Will cause the mutating table if the trigger doesn't get handled well.

Statement level triggers: Fire only once but perform DML on multiple rows which meet the condition. Will not cause the mutation, Doesn't allow the When clause, and doesn't allow the use of :old.variableName or new.variableName.. Triggers do not cause mutating tables in the reason is because they completely fire before or after the DML statement. Because of this the table won’t be changing when the trigger is fired.

Statement level triggers: this type of trigger executes for every SQL statement executed. Row triggers are useful if the code in the trigger action depends on data provided by the triggering statement or rows that are affected. Statement triggers are useful if the code in the trigger action does not depend on the data by the triggering statement or the rows affected.

Discussion Thread 2

Title: Advantages and Disadvantages of triggers (2 postings)

Triggers are fired implicitly on the tables/views on which they are created. There are various advantages and disadvantages of using a trigger. A reason of using triggers can be for automatic updating of one or more tables whenever a DML/DDL statement is executed for the table on which the trigger is created. Triggers can be used to enforce constraints. For example, any insert/update/ delete statements should not be allowed on a particular table after office hours. For enforcing this constraint Triggers should be used. Triggers can be used to publish information about database events to subscribers. Database event...