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. Expand the table that contains the trigger.
  2. Under the Triggers folder, find the trigger you want to edit, right-click the trigger, and choose Edit.

    The Trigger Editor page opens.

  3. Edit the trigger properties.
    Editor Tab Description
    General
    • Change the trigger name in the Name field.
    • Select For update, For insert, or For delete to indicate the condition under which the trigger is to be invoked when the associated table is modified.
    • Enter an optional 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.
    • In the Trigger Columns field, choose the check boxes of 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 have specified 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 have specified 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 have specified 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 choose Show Line Numbers from the context menu.
    DDL Select this tab to view the DDL for the trigger. Content in this tab is not modifiable.
  4. When you are finished editing the trigger, choose File > Save from the main WorkSpace menu to save your changes.
Related concepts
Triggers
Related tasks
Creating a SQL Anywhere Trigger
Creating an ASE Trigger
Editing an ASE Trigger
Dropping a Trigger
Renaming a Trigger

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.