Editing a SQL Anywhere Trigger

Edit a trigger to change the name, trigger events, and other properties.

Prerequisites 

Before you can edit a trigger, be sure the data server that contains the trigger is running, and you created and established a connection to the data server.

  1. In the Databases folder in Enterprise Explorer, under the database connection profile, expand the tree for a database, expand the Schemas folder and then the tree for the appropriate schema owner.
  2. Expand the table that contains the trigger.
  3. Under the Triggers folder, right-click the trigger, and select Edit.
  4. Edit the trigger properties.
    Editor Tab Description
    General
    • Change the Name.
    • Select For Update, For Insert, or For Delete to indicate the condition under which the trigger invokes when the associated table is modified.
    • (Optional) Enter a description in the Comments field.
    • Specify the trigger event properties:
      • Specify the trigger isolation level as either Row Level or Statement Level.
      • Specify the trigger firing time as Before, After, or Resolved. The Before and After options result in the trigger being fired before or after the specified row or statement is altered or executed. Choosing Resolved results in the trigger being fired before row-level updates or column updates only and is for use with SQL Remote.
      • Specify Insert, Update, Delete, or Update Column to indicate the condition under which the trigger is to be invoked when the associated table is modified. Choosing Update column results in the trigger being fired on column updates.
    • For Trigger Columns, select the columns that you want updated when the trigger is invoked.
    • Enter the Order number, which determines the order in which triggers of the same type (insert, update, or delete) are fired.
    • Specify the data to be referenced:
      • Old – if you specify row-level isolation, the name you enter here refers to the values of a row before an update or delete. If you have specified statement-level isolation, the name you enter here refers to declared temporary tables holding the old and new values of the rows.
      • New – if you specify row-level isolation, the name you enter here refers to inserted row values after an update or insert. If you have specified statement-level isolation, the name you enter here refers to declared temporary tables holding the old and new values of the rows.
      • Remote – if you specify the trigger firing time as Resolved, the name you enter here refers to the values in the verify clause of an update statement.
    Source Manually edit the SQL code for the trigger in the Source tab. To display line numbers for the SQL code, right-click in the left margin, and select Show Line Numbers.
    DDL View the DDL for the trigger (read-only).
  5. When you are finished editing the trigger, select File > Save from the main WorkSpace menu.
Related concepts
Triggers
Related tasks
Creating a SQL Anywhere Trigger
Creating an ASE Trigger
Editing an ASE Trigger
Dropping a Trigger
Renaming a Trigger


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com