Inserting a Template Item into a Trigger or Trigger Template

Template items are inserted in a trigger or trigger template definition using a dot followed by the template item name. For example, the following script contains two template items InsertChildParentExist and InsertTooManyChildren:

/*  Before insert trigger "%TRIGGER%" for table "[%QUALIFIER%]%TABLE%"  */
create trigger %TRIGGER% before insert order %ORDER% on [%QUALIFIER%]%TABLE%
referencing new as new_ins for each row
begin
  declare user_defined_exception exception for SQLSTATE '99999';
  declare found integer;
  .InsertChildParentExist
  .InsertTooManyChildren
end
/
  1. Open the property sheet of the trigger or trigger template that you want to modify, and then click the Definition tab.
  2. Click at the point in the code where you want to insert the trigger template item, and then click one of the following tools:
    • Add Trigger Item From DBMS – to open a selection box containing a list of trigger template items defined in the DBMS definition file

    • Add Trigger Item From Model – to open a selection box containing a list of trigger template items defined in the model



  3. Select the item to insert and then click OK to return to the definition tab.

    The trigger template item will be inserted in your code. It will also appear in the list on the Template Items tab.