Debugging a Trigger

Debug a trigger using the Sybase WorkSpace debugging tools.

Prerequisites You must be connected to the database that contains the trigger you want to debug. Do not attempt to edit a table while you are debugging a trigger in that table.
Note: When you are debugging a trigger, the table on which the trigger is defined is accessible only at isolation level 0. To be accessible at isolation level 0, the table must have a unique index. Therefore, to be displayed in the Referenced Tables view in the Database Debug perspective, the trigger table must have a unique index. If the table does not have a unique index, you may receive an error message like the following: The optimizer could not find a unique index, which it could use to perform an isolation level 0 scan on table <table_name>
  1. Expand the Tables folder and then theTriggers folder.
  2. Find the trigger you want to debug, right-click the trigger, and choose Edit.

    The Trigger Editor opens.

  3. In the Source tab, set a breakpoint in the trigger by double-clicking in the bar to the left of the SQL code.
  4. Right-click in the content window, choose Debug from the context menu.

    The Edit configuration and launch wizard opens.

  5. In the Run box, enter a SQL statement that causes the trigger to run with the values you want.

    You can enter the SQL manually, or click SQL to use Visual SQL.

  6. Click Debug.

    The perspective switches to Database Debug, and the trigger executes up to the breakpoint.

  7. Debug the trigger using step-in, step-over, or resume in Debug.
Related tasks
Debugging a Procedural Object
Dumping Debug Variables and Referenced Table Data
Debugging a Table in Referenced Tables View
Debugging an External Client
Related reference
SQL Anywhere Trigger Rows View

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com