Chapter 5 Building Triggers and Procedures
Creating a trigger template
You can create a new trigger template in your DBMS definition file or as part of your model. You can begin by copying an existing template or write one from scratch.two types of trigger templates:
To create a trigger template:
- To create a DBMS trigger template: select Database→Edit Current DBMS to open the DBMS definition file in the resource editor, and then click the Trigger Templates tab:
or
To create a model trigger template: select Model→Triggers→Trigger Templates to open the List of User-Defined Trigger Templates:
- Click on one of the following tools:
- Create from DBMS trigger template – opens a selection box listing all the trigger templates available in the current DBMS. Select a check box for the type of trigger template that you want to use as the basis for your new template and click OK to return to the trigger template list. The duplicate DBMS template has been added to the list.
- Add a Row – adds a new blank template to the list.
- Type a new name and code for the new template and click Apply to commit its creation.
- Click the Properties tool to open the property sheet of the new trigger template:
- Click the Definition tab and enter or modify the definition code. You can add trigger template items, use PDM variables and macros and various other tools available from the toolbar. For more information, see "Using the Definition tab toolbar".
- You can also modify other of the trigger template's properties. For a full list of the properties available, see "Trigger template properties".
- Click OK in each of the dialog boxes.
If you have created DBMS trigger template, a confirmation box will appear, asking if you want to save the changes to the DBMS.
Click Yes to confirm the template creation.
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|