Run a trigger to obtain SQL results from the database.
-
In the Databases folder in Enterprise Explorer, under the database connection profile, expand the navigation tree for the appropriate database and schema owner.
Database |
Steps |
From an ASE connection profile |
- Expand the Databases folder.
- Expand the tree for a database
and then the tree for the appropriate schema owner.
|
From a SQL Anywhere or Sybase IQ connection profile |
- Expand the
tree for a database.
- Expand the
Schemas folder and then the tree for the appropriate schema owner.
|
-
Expand
the
Tables folder, the table where the trigger is located, and then the Triggers folder.
-
Right-click the trigger and select
Run.
-
Make sure the
Trigger field in the
Type frame is selected.
-
To modify the trigger SQL, click the
SQL... button, and select
Insert,
Update, or
Delete.
-
Construct a query with Visual SQL, and click OK.
-
Click
Apply to apply the value changes to the launch
configuration.
-
Click
Run to run the trigger.
View results in
SQL Results view.
-
Open
the
Triggers folder and double-click the trigger
name.
Its SQL code appears in the Procedural Object Editor.
-
Place
the cursor in the code where you want to enter new values into the trigger's
SQL code.
-
Right-click to select
Visual SQL and select
Insert,
Update, or
Delete.
The SQL Select Table dialog appears.
-
Select a table and click
Open.
The Column Values page (insert, update or delete) appears.
-
In
the
Column Name field, insert the values that you
want the trigger to use by clicking on the column name.
Use the buttons to insert a Null value; Select to return the
values to be inserted by the insert statement; and Clear to remove any entered
insert values. Add arguments as appropriate. If you selected Delete, you see a
list of columns in the table; use the various clause tabs to modify the Delete
trigger.
Statement |
Action |
insert
|
All column names appear. In the Column Name field, enter
values that you want the trigger to insert.
|
update |
Choose the columns whose values you want the trigger to
update by single-clicking the column name. Enter values in the Column Name
field.
|
delete |
No action at the statement level. Use the Where and Having
clause tabs to limit the rows the trigger deletes.
|
Use the drop-down lists on the Where and Having tabs to delimit
the rows you want the trigger to insert, update, or delete. Manipulate the
columns in the Sort and Group clauses to organize the ways in which results are
returned. See Using Visual SQL to Edit a Procedural Object to obtain more
information about clauses.
You
can preview the code you have created by selecting the Preview tab. When you
are finished, click OK to return to the Modify Attributes and Launch page.
-
&&& need
substeps for step 6.
-
Right-click
in the Procedural Object Editor and select
Run to run the trigger.