Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Queries and the Query Optimizer >

Trigger Execution

A trigger is a database mechanism that executes an SQL statement automatically when a certain event occurs. You can set up a trigger on a table to execute for a SELECT, INSERT, UPDATE or DELETE statement. For more information about using triggers, consult the IBM Informix: Guide to SQL Tutorial and the CREATE TRIGGER statement in the IBM Informix: Guide to SQL Syntax.

Figure 61. Trigger Information Stored in System Catalog Tables
begin figure description - This figure is described in the surrounding text. - end figure description

When you create a trigger with the CREATE TRIGGER statement, the database server puts information about the trigger in the systriggers system catalog. The server puts the statement that the trigger executes into the systrigbody system catalog. In addition, dictionary tables stored in memory indicate whether the table has triggers defined for it. Whenever the database server executes a SELECT, INSERT, UPDATE, or DELETE statement, it must check if a trigger is defined for the type of statement and the table and columns on which the statement operates. If the statement requires a trigger to be executed, the database server retrieves the statement text from systrigbody and executes the SPL routine when required before, during, and after the statement.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]