# Programming trigger actions

Derby allows you to create triggers. When you create a trigger, you define an action or set of actions that are executed when a database event occurs on a specified table. A database event is a delete, insert, or update operation.

For example, if you define a trigger for a delete on a particular table, the trigger action is executed whenever someone deletes a row or rows from the table.

The "CREATE TRIGGER statement" topic in the Derby Reference Manual shows the complete `CREATE TRIGGER` syntax. This section provides information on defining the trigger action itself, which is only one aspect of creating triggers.

This section refers to the actions defined by the `CREATE TRIGGER` statement as the trigger actions.

- Trigger action overview
  A trigger action is a simple SQL statement.
- Performing referential actions
  Derby provides referential actions. Examples in this section are included to illustrate how to write triggers.
- Accessing before and after rows
  Many trigger actions need to access the values of the rows being changed.
- Examples of trigger actions
  This section provides some examples of triggers.
- Triggers and exceptions
  Exceptions raised by triggers have a statement severity; they roll back the statement that caused the trigger to fire.

Parent topic: Derby server-side programming
Related concepts
Programming database-side JDBC routines