Home | Previous Page | Next Page   Creating and Using Triggers >

How to Create a Trigger

You use the CREATE TRIGGER statement to create a trigger. The CREATE TRIGGER statement is a data-definition statement that associates SQL statements with a precipitating action on a table. When the precipitating action occurs, it triggers the associated SQL statements, which are stored in the database. Figure 473 illustrates the relationship of the precipitating action, or trigger event, to the triggered action.

Figure 473. Trigger Event and Triggered Action
begin figure description - This figure is described in the surrounding text. - end figure description

The CREATE TRIGGER statement consists of clauses that perform the following actions:

An optional clause, called the REFERENCING clause, is discussed in Using FOR EACH ROW Triggered Actions.

To create a trigger, use DB–Access or one of the SQL APIs. This section describes the CREATE TRIGGER statement as you enter it with the interactive Query-language option in DB–Access. In an SQL API, you precede the statement with the symbol or keywords that identify it as an embedded statement.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]