
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is MySQL trigger and triggering events related to it?
Basically, MySQL trigger is a set of statements stored in the database catalog. This database object is always associated with a table that is defined to be activated when a particular kind of event occurs for that table. In other sense, we can say that MySQL trigger is a special kind of stored procedure. Its main difference with the stored procedure is that it is not called directly like a stored procedure. It is called automatically when a data modification even against the table occurs. The trigger can be executed when you run one of the following MySQL statements on the table: INSERT, UPDATE, and DELETE and it can be invoked before or after the event. Triggers appear to execute quietly without the user even knowing of their existence. They cannot include COMMIT or ROLLBACK statements.
Triggering events are basically the action of time i.e. when the trigger activates. Followings are the triggering events related to MySQL triggers −
- INSERT − As its name suggests, this indicates the trigger event is related to the insertion of data in MySQL table. In this case, the trigger would be triggered either before or after the insertion of data happens.
- DELETE − As its name suggests, this indicates the trigger event is related to the deletion of data in MySQL table. In this case, the trigger would be triggered either before or after deletion of data happens.
- UPDATE − As its name suggests, this indicates the trigger event is related to the update of data in MySQL table. In this case, the trigger would be triggered either before or after an updating of data happens.
- Related Articles
- What is MySQL event and how it is related to trigger?
- What is ECMAScript and how it is related to JavaScript?
- What is anode and cathode? Elaborate terms related to it.
- What is Profit Planning and how is it related to Finance Function?
- What is ionic and how is it related with HTML5?
- How is it possible for a MySQL trigger to execute multiple statements?
- How to trigger the same function with jQuery multiple events?
- What is the difference between Local Events and Global Events in jQuery?
- How to ceate MySQL Trigger before Insert?
- What does DELIMITER // do in a Trigger in MySQL?
- Is it good to dream? How is your success related to your dreams?
- MySQL trigger to insert row into another table?
- MySQL Installation Related Programs
- How can we create and use a MySQL trigger?
- Drop trigger if exists in MySQL?
