What is trigger? TRIGGER : --> SQL Trigger is an event-driven action or database callback function which is invoked automatically when an INSERT, UPDATE, and DELETE statement is performed on a specified table. The main tasks of triggers are like enforcing business rules, validating input data, and keeping an audit trail. Usage of Triggers: 1. Triggers are used for enforcing business rules. 2. Validating input data. 3.Generating a unique value for a newly-inserted row in a different file. 4.Write to other files for audit trail purposes. 5. Query from other files for cross-referencing purposes. 6. Used to access system functions. 7. Replicate data to different files to achieve data consistency. Advantages of using triggers Triggers make the application development faster. Because the database stores triggers, you do not have to code the trigger actions into each database application. Define a trigger once and you can reuse it for many applications that use...
Comments
Post a Comment