Creating a Trigger Template Item

You usually create a template item when an existing template item is not suitable, or to create a repeatable block of code to do updating work on tables in the database.

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.

  1. To create a DBMS trigger template item: select Database > Edit Current DBMS to open the DBMS definition file in the resource editor, and then click the Trigger Template Items tab:


    or

    To create a model trigger template item: select Model > Triggers > Trigger Template Items to open the List of User-Defined Trigger Template Items:



  2. Click on one of the following tools:
    • Create from DBMS Trigger Item – opens a selection box listing all the trigger template items available in the current DBMS. Select a check box for the type of item that you want to use as the basis for your new item and click OK to return to the trigger template item list. The duplicate DBMS template item has been added to the list.

    • Add a Row – adds a new blank template item to the list.

  3. Type a new name and code for the new template item and click Apply to commit its creation.
  4. Click the Properties tool to open the property sheet of the new template item:


  5. Click the Definition tab and enter or modify the definition code. You can use PDM variables and macros and various other tools available from the toolbar. For more information, see SQL Editor Tools.
  6. You can also modify other of the trigger template item'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 item, a confirmation box will appear, asking if you want to save the changes to the DBMS.

    Click Yes to confirm the template creation.