20.16. The INFORMATION_SCHEMA TRIGGERS Table

MySQL 5.0

20.16. The INFORMATION_SCHEMA TRIGGERS Table

The table provides information about triggers. You must have the privilege to access this table.

Name Name Remarks
 
   
 
 
 
   
 
 
 
 
 
 
 
 
 
 
  ()
  MySQL extension
  MySQL extension

Notes:

  • The table was added in MySQL 5.0.10.

  • The and columns contain the name of the database in which the trigger occurs and the trigger name, respectively.

  • The column contains one of the values , , or .

  • As noted in Chapter 18, Triggers, every trigger is associated with exactly one table. The and columns contain the database in which this table occurs, and the table's name.

  • The statement contains the ordinal position of the trigger's action within the list of all similar triggers on the same table. Currently, this value is always , because it is not possible to have more than one trigger with the same and on the same table.

  • The column contains the statement to be executed when the trigger is invoked. This is the same as the text displayed in the column of the output from . Note that this text uses UTF-8 encoding.

  • The column always contains the value .

  • The column contains one of the two values or .

  • The columns and contain the old and new column identifiers, respectively. This means that always contains the value and always contains the value .

  • The column shows the server SQL mode that was in effect at the time when the trigger was created (and thus which remains in effect for this trigger whenever it is invoked, regardless of the current server SQL mode). The possible range of values for this column is the same as that of the system variable. See Section 5.2.5, “The Server SQL Mode”.

  • The column was added in MySQL 5.0.17. indicates who defined the trigger.

  • The following columns currently always contain : , , , , , and .

Example, using the trigger defined in Section 18.3, “Using Triggers”:

mysql> 
*************************** 1. row ***************************
           TRIGGER_CATALOG: NULL
            TRIGGER_SCHEMA: test
              TRIGGER_NAME: ins_sum
        EVENT_MANIPULATION: INSERT
      EVENT_OBJECT_CATALOG: NULL
       EVENT_OBJECT_SCHEMA: test
        EVENT_OBJECT_TABLE: account
              ACTION_ORDER: 0
          ACTION_CONDITION: NULL
          ACTION_STATEMENT: SET @sum = @sum + NEW.amount
        ACTION_ORIENTATION: ROW
             ACTION_TIMING: BEFORE
ACTION_REFERENCE_OLD_TABLE: NULL
ACTION_REFERENCE_NEW_TABLE: NULL
  ACTION_REFERENCE_OLD_ROW: OLD
  ACTION_REFERENCE_NEW_ROW: NEW
                   CREATED: NULL
                  SQL_MODE:
                   DEFINER: me@localhost

See also Section 13.5.4.23, “ Syntax”.