更新时间:2025-05-29 GMT+08:00

INFORMATION_SCHEMA.TRIGGERS

显示所有定义在当前数据库中表和视图上的触发器,并且只显示当前用户拥有的触发器或当前用户在其上具有某种除了SELECT之外特权的触发器,如表1所示。

表1 INFORMATION_SCHEMA.TRIGGERS字段

名称

类型

描述

trigger_catalog

information_schema.sql_identifier

包含该触发器的数据库名。

trigger_schema

information_schema.sql_identifier

包含该触发器的模式名。

trigger_name

information_schema.sql_identifier

触发器名称。

event_manipulation

information_schema.character_data

触发该触发器的事件类型(INSERT、UPDATE、DELETE)。

event_object_catalog

information_schema.sql_identifier

包含该触发器所在表的数据库名。

event_object_schema

information_schema.sql_identifier

包含该触发器所在表的模式名。

event_object_table

information_schema.sql_identifier

触发器所在表的名称。

action_order

information_schema.cardinal_number

同一个表上具有相同event_manipulation、action_timing、action_orientation的触发器之间的触发顺序。

action_condition

information_schema.character_data

触发器的WHEN条件,默认为空。

action_statement

information_schema.character_data

触发器执行的语句。

action_orientation

information_schema.character_data

标识触发器是对每个被处理的行触发一次还是为每个语句触发一次。

action_timing

information_schema.character_data

触发器在什么时候触发(BEFORE、AFTER、INSTEAD OF)。

action_reference_old_table

information_schema.sql_identifier

无实际意义,取值为空。

action_reference_new_table

information_schema.sql_identifier

无实际意义,取值为空。

action_reference_old_row

information_schema.sql_identifier

无实际意义,取值为空。

action_reference_new_row

information_schema.sql_identifier

无实际意义,取值为空。

created

information_schema.time_stamp

无实际意义,取值为空。

INFORMATION_SCHEMA.TRIGGERS视图只显示事件类型为INSERT、UPDATE、DELETE的触发器,不显示事件类型为TRUNCATE的触发器。