IBM Database Add-Ins for Visual Studio  

Creating Triggers

The IBM® Database Add-Ins for Visual Studio simplify the process of creating triggers. You can use one of the following tools to create an IBM database trigger:

With the designers, you provide information about the trigger, specify the time and event to start the trigger, create the table or view SQL condition, specify the action that the trigger will perform, and specify script options for the trigger.

To create a trigger by using a designer:

  1. Start creating a table or a view, or changing a table or view definition by using the IBM Table Designer or the IBM View Designer.
  2. From the associated designer menu, select Triggers.

    The Triggers view of the designer is displayed.

  3. Add one or more triggers and define the properties and columns for each trigger.

    For detailed information about fields in the Triggers view, see Triggers, Designer.

  4. Continue creating the table or view, or changing the table or view definition.

To create a trigger by using the editor:

  1. In the Solution Explorer, right-click the Triggers folder under your IBM database project, select Add on the shortcut menu, and then select New Item.

    The Add New Item window opens.

  2. In the Categories list, select Triggers.
  3. In the Templates list, select Trigger Script.
  4. In the Name field, type a name for the new trigger file, and then click Add.

    A new trigger file with a basic structure is created and added to your project.

  5. Use the editor to make changes to the trigger.
  6. To save your changes, select File, and then select Save [file name].

See Also

Developing IBM Database Triggers | IBM Database Triggers | Creating Tables | Creating Views | Changing Table Definitions | Changing View Definitions


.NET Development Forum   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.