Only in DbVisualizer Pro
This feature is only available in the Pro edition. In the Free edition, please execute the corresponding SQL in the SQL Commander.
The Create Trigger dialog helps you create a trigger for a table.
Opening the Create Trigger Dialog
To create a trigger for a table:
- Locate the table in the Databases tab tree,
- Select the table node and open the Create Trigger dialog from the right-click menu,
- Enter the required info in the fields, e.g. trigger name. The fields are database dependent so the figure is just an example,
- The Source area contains stub code that you can later edit in the Trigger Editor. For most databases you can leave it as is, but for some databases, you must adjust the stub code to match your database objects.
- Click the Execute button to create the trigger
To edit the trigger code:
- Expand the Trigger node for the table in the Databases tab tree,
- Double-click the trigger node to open its Object View tab,
- Open the Trigger Editor tab and edit the code in the editor,
- Click the Save toolbar button to save (and for some databases, compile) the trigger.
If the database reports any errors, the location of the errors are highlighted with curly red underlines in the editor for most databases. Hovering the mouse over such an underline shows the error message.
The Log tab in the results area also lists all errors. Clicking on the icon next to an error message selects the corresponding line and positions the caret at the error location, if the database reports error locations.