Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Stored procedures, triggers, batches, and user-defined functions » Triggers

 

Altering a trigger

Alter a trigger by using Sybase Central to edit the code of the trigger or add a comment.

Prérequis

To add or edit a comment, you must have one of the following system privileges:

  • COMMENT ANY OBJECT
  • ALTER ANY TRIGGER
  • ALTER ANY OBJECT
  • CREATE ANY TRIGGER
  • CREATE ANY OBJECT

To edit the code, you must have the ALTER ANY OBJECT system privilege or the ALTER ANY TRIGGER system privilege and one of the following:

  • You must be owner of the underlying table
  • ALTER ANY TABLE system privilege
  • ALTER privilege on the underlying table

Contexte et remarques

In Sybase Central, you cannot rename an existing trigger directly. Instead, you must create a new trigger with the new name, copy the previous code to it, and then delete the old trigger.

 Task
  1. In Sybase Central, use the SQL Anywhere 16 plug-in to connect to the database.

  2. In the left pane, double-click Triggers.

  3. Select a trigger.

  4. Use one of the following methods to alter the trigger:

    Option Action
    Edit the code

    You can either right-click the trigger and click Edit in New Window, or you can edit the code in the SQL tab in the right pane.

    Tip

    You can open a separate window for each procedure and copy code between triggers.

    Add a comment

    To add or edit a trigger comment, right-click the trigger and click Properties.

    If you use the Database Documentation Wizard to document your SQL Anywhere database, you have the option to include these comments in the output.

Résultat

The code of the trigger is altered.

 See also