PowerDesigner trigger templates allow you to write trigger code in a modular reusable fashion. We provide basic templates for before, after, and with insert, update, and delete events and for other types of triggers where supported by the DBMS. You can modify the code specified in these templates or create your own templates in the DBMS definition file or in your model.
To apply a trigger template to your trigger definition, select the template from the list on the trigger property sheet Definition tab (see Trigger and DBMS Trigger Properties).
The General tab contains the following properties:
Property |
Description |
---|---|
Name/Code/Comment |
Identify the object. The name should clearly convey the object's purpose to non-technical users, while the code, which is used for generating code or scripts, may be abbreviated, and should not normally include spaces. You can optionally add a comment to provide more detailed information about the object. By default the code is generated from the name by applying the naming conventions specified in the model options. To decouple name-code synchronization, click to release the = button to the right of the Code field. |
DBMS |
Specifies the parent DBMS. |
Applies to |
[for DBMSs supporting multiple types of triggers] Specifies whether the template can be applied to table, view, or DBMS triggers. |
Trigger time |
Specifies when triggers based on the template will fire in relation to their associated event. |
Trigger event |
Specifies the event that will cause the firing of triggers based on the template. |
Trigger name |
Specifies the conventions for naming triggers based on the template. |
Keywords |
Provide a way of loosely grouping objects through tagging. To enter multiple keywords, separate them with commas. |