1.

What Is The Advantage To Use Trigger In Your Pl?

Answer»

A trigger is a database object directly associated with a particular table. It fires whenever a specific statement/type of statement is issued against that table. The types of statements are insert,update,delete and query statements. Basically, trigger is a set of SQL statements A trigger is a solution to the restrictions of a constraint. For INSTANCE:

  1. A database column cannot carry PSEUDO columns as criteria where a trigger can. 
  2. A database constraint cannot refer old and new values for a row where a trigger can.

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.

A trigger is a database object directly associated with a particular table. It fires whenever a specific statement/type of statement is issued against that table. The types of statements are insert,update,delete and query statements. Basically, trigger is a set of SQL statements A trigger is a solution to the restrictions of a constraint. For instance:

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:



Discussion

No Comment Found