What is the advantage to use trigger in your PL?

Showing Answers 1 - 3 of 3 Answers

Aparna Akella

  • Jul 17th, 2006
 

Triggers are fired implicitly on the tables/views on which they are created. There are various advantages of using a trigger. Some of them are:

- Suppose we need to validate a DML statement(insert/Update/Delete) that modifies a table then we can write a trigger on the table that gets fired implicitly whenever DML statement  is executed on that table.

- Another reason of using triggers can be for automatic updation 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 eg : 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 can be a system event like Database startup or shutdown or it can be a user even like User loggin in or user logoff.

chennoju

  • Aug 3rd, 2006
 

The main advantages of the triggers are

* To Audit the table

* To check the complex conditions which are not possible by the constraints.

  Was this answer useful?  Yes

bhagya

  • Feb 10th, 2012
 

1.Auditing the tables
2.Online transaction
3.Securing from another table
4.Automatic calculations
5.Replicate the tables

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions