- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How we can find all the triggers associated with a particular MySQL table?
152 Lectures 16 hours
87 Lectures 5.5 hours
We can find all the triggers associated with a particular table with the help of the following query −
mysql> Select * from INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA = 'query'AND EVENT_OBJECT_TABLE = 'Student_info'\G *************************** 1. row *************************** TRIGGER_CATALOG: def TRIGGER_SCHEMA: query TRIGGER_NAME: studentinfo_after_delete EVENT_MANIPULATION: DELETE EVENT_OBJECT_CATALOG: def EVENT_OBJECT_SCHEMA: query EVENT_OBJECT_TABLE: student_info ACTION_ORDER: 1 ACTION_CONDITION: NULL ACTION_STATEMENT: BEGIN DECLARE vuser varchar(30); SELECT USER() into vuser; INSERT INTO student_info_deleted(id,deleted_date,deleted_by) VALUES(OLD.id,SYSDATE(),vuser); END ACTION_ORIENTATION: ROW ACTION_TIMING: AFTER ACTION_REFERENCE_OLD_TABLE: NULL ACTION_REFERENCE_NEW_TABLE: NULL ACTION_REFERENCE_OLD_ROW: OLD ACTION_REFERENCE_NEW_ROW: NEW CREATED: 2017-11-21 14:19:34.91 SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION DEFINER: root@localhost CHARACTER_SET_CLIENT: cp850 COLLATION_CONNECTION: cp850_general_ci DATABASE_COLLATION: latin1_swedish_ci 1 row in set (0.00 sec)
The above result set is showing the list of triggers on the ‘student_info’ table in the database named ‘query’.
- How can we fetch all the records from a particular MySQL table?
- How can we use SIGNAL statement with MySQL triggers?
- How can we find out the storage engine used for a particular table in MySQL?
- How can we check the list of all triggers in a database?
- How can we use INFORMATION_SCHEMA to get the details about triggers in a particular database?
- How can we delete all rows from a MySQL table?
- How can we fetch a particular row as output from a MySQL table?
- How can we get the metadata of triggers?
- How can we list all the columns of a MySQL view as we can list the columns of a MySQL table?
- How to insert DATE in MySQL table with TRIGGERS?
- How can we check the character set of all the tables in a particular MySQL database?
- How can we update MySQL table after removing a particular string from the values of column?
- How to get the details of all the triggers associated with a job from AWS Glue Data catalog using Boto3
- Update MySQL table on INSERT command with triggers?
- How to get the data associated with the maximum id in a MySQL table?