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:

Steps To create a trigger template:

  1. 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:
  2. Click on one of the following tools:

  3. Type a new name and code for the new template and click Apply to commit its creation.
  4. Click the Properties tool to open the property sheet of the new trigger template:
  5. 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".
  6. You can also modify other of the trigger template's properties. For a full list of the properties available, see "Trigger template properties".
  7. 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.