This section describes how to use triggers in DMS.
You have access permissions to DMS and you have logged on to the DMS console.
Select a target database and click Log on to Database.
Triggers, functions, stored procedures, and events are programmable objects in DMS. In the left-side directory tree, click the Programmable Objects tab. Programmable objects are displayed.
Right-click on the Trigger list and select Build (Trigger). The New: Trigger page is displayed as shown below.
Enter required information to configure the trigger.
Configure the trigger.
- Enter the trigger name.
- Select a trigger table. This example selects the dmstest marked by 1.
- Select trigger time. In this example, select Trigger After Event.
- Select a trigger event. In this example, select Insert Event.
Configure a trigger statement.
- Set the operation that the trigger performs when the specified event occurs.
Click Save after you complete trigger settings. DMS then generates the SQL statement used to create the trigger based on your settings. Confirm the SQL statement.
Click OK. DMS then saves the trigger to your database. DMS returns a message indicating that the trigger is successfully saved. Click Programmable Objects > Trigger to check the saved trigger.
Check the result set in the SQL window to verify that the Insert operation is correctly processed by the trigger as shown below.
Click Programmable Objects > Trigger to perform trigger-related operations through the following menu options.
- Create (Trigger)
- Edit (Trigger)
- Delete (Trigger)