Aqua Data Studio provides visual editors for creating and editing Views and Triggers. By navigating the schema browser you may locate the Views container or the Triggers container.
View
A view is a stored query accessible as a virtual table composed of the result set of a query. Views are dynamic - changing the data in a table alters the data shown in a view. Views are represented by an icon of glasses. When an ER Model is generated from a database, views are easily identified in the Model Node Browser.
To create a View, connect to a database server, right click on the Views container for a database and select Create View from the menu. When the Create View property window appears, select the schema, name the view and enter the SQL you wish to be used in the view. Once the SQL is entered, you can view it in the Preview SQL tab. Click ok to finish.
1. Connect to Server
2. Right Click Views
3. Name and Write View
4. Preview View SQL
To edit or ALTER an existing View, right click on the View within the Views container and select Alter View.
Trigger
A Trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. There are two classes of triggers, they are either row triggers or statement triggers. Each class can be of several types. There are BEFORE triggers and AFTER triggers. There is also an INSTEAD OF trigger, which will execute instead of the triggering statement. Triggers can be set to "fire" when there is an UPDATE, EDIT or DELETE in a table.
To create a Trigger, connect to a database server, right click on the Triggers container for a database and select Create Trigger from the menu. When the Create Trigger property window appears, select the schema, name the Trigger and enter the SQL you wish to be used in the view. Once the SQL is entered, you can view it in the Preview SQL tab. Click ok to finish. What causes a trigger to fire varies depending on database vendor and version.
1. Connect to Server
2. Right Click Triggers
3. Name and Write Trigger
4. Preview Trigger SQL
ALTER
To edit or ALTER an existing Trigger, right click on the Trigger within the Triggers container and select Alter Trigger.
DROP
To DROP an existing Trigger, right click on the Trigger within the Triggers container and select DROP Trigger.