Category: Triggers
-
DROP TRIGGER
In SQLite, DROP TRIGGER command is used to drop/ delete trigger from a table. Syntax: Example: See the given example. It has 5 triggers: Let’s drop the trigger named “audit_log”. Now you can see “audit_log” is dropped.
-
AFTER INSERT/ BEFORE INSERT
It specifies how to create trigger after insert the data. Suppose, we have two tables COMPANY and AUDIT, here we want to keep audit trial for every record being inserted in newly created COMPANY table .If you have already a COMPANY table, drop it and create again. COMPANY table: Create a new table named AUDIT…
-
Triggers
SQLite 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: Advantages of using triggers: How to create…