You can create a trigger without basing it on a template. However, we recommend that you use a template as this will simplify reuse of your code and make your triggers more portable.
- Open a table property sheet and click the Triggers tab.
- Click the Add a Row tool to create a new trigger, and enter a name and code.
- Click Apply to commit the creation of the new trigger, and then click the Properties tool to open its property sheet.
- Click the Definition tab.
- Enter the trigger definition code. You can add trigger template items, use PDM variables and macros and various other tools available from the toolbar (see SQL Editor Tools).
The trigger will be marked as user-defined and will be excluded from most forms of rebuilding (see Rebuilding Triggers).
- You can also modify the trigger's other properties (see Trigger and DBMS Trigger Properties).
- Click OK in each of the dialog boxes.
Note:
When using the PowerDesigner Eclipse plug-in, you can right-click a trigger in the Browser and select Edit in SQL Editor to open it in the Eclipse SQL Editor. You can optionally connect to your database in order to obtain auto-completion for table names. The trigger definition is added as a .SQL file to the Generated SQL Files list in the Workspace Navigator.