Work with triggers
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Database triggers are not part of the SQL standard, but are supported in the OpenEdge environment. Triggers are a special type of stored procedure used to maintain database integrity by enforcing specific business logic.
Database triggers are supported using Java. The OpenEdge SQL Engine adds wrapper code around a trigger to create a Java class and method that is invoked when the trigger fires. When creating a database trigger, the compiled Java class generated is stored within the database as well as the original source.
Triggers are a special type of stored procedure used to maintain database integrity.
Like stored procedures, triggers also contain Java code (embedded
in a CREATE TRIGGER statement) and use OpenEdge SQL Java
classes. However, triggers are automatically invoked (fired) by
certain SQL operations (an insert, update, or delete operation)
on the trigger's target table.
This topic provides a general description of triggers and discusses in detail where trigger procedures differ from stored procedures. Unless otherwise noted, the material in earlier sections also applies to triggers.