Triggers (PDM)

A trigger is a segment of SQL code associated with a table or a view, which is invoked automatically whenever there is an attempt to modify data in the associated table or view with an insert, delete, or update command.

You can use triggers to enforce referential integrity (where declarative constraints are not sufficient) and to implement sequences for columns.

Trigger Templates and Template Items

A trigger template is a pre-defined form for creating triggers. PowerDesigner ships templates for each supported DBMS. Depending on the current DBMS, there are pre-defined templates for insert, update, and delete trigger types.

A template item is a reusable block of SQL script that can implement referential integrity, or do any other work on database tables. PowerDesigner ships template items for each supported DBMS. A template item is inserted into a trigger template script, or a trigger script. The template item calls a corresponding SQL macro which can implement an insert, update, delete, or error message constraint on one or more tables in the database.

You can use the PowerDesigner templates and template items, copy and edit them, or create your own from scratch. For more information, see Trigger Templates (PDM).