Database Development offers a complete set of views for debugging procedural objects. You can set breakpoints by double-clicking the left vertical ruler in SQL Editor, or by right-clicking the left vertical ruler and selecting Toggle Breakpoint. The Toggle breakpoint can also be used for setting the breakpoint. If the line is not appropriate for a breakpoint, the marker (a blue dot) automatically adjusts to the next appropriate line in the code. You can remove breakpoints by double-clicking or right-clicking the marker and selecting Toggle Breakpoint.
There are several steps in debugging your code:
After you set the breakpoints, begin debugging via the SQL Editor context menu option Debug, which automatically switches the perspective to Database Debug and suspends execution at the first breakpoint. While switching the perspective, click OK on the dialog that appears to confirm the perspective switch.
In Debug, with the cursor at a breakpoint, use the appropriate toolbar buttons to step into or over a line of code. See Debugging Procedural Objects.
Use the Variables view to track the variables in the expressions that the debugger has evaluated.
To change the value of a variable, double-click its name in the Variables view. The Set Value dialog appears. Enter a new value for the variable and click OK. You can also change the value by right-clicking the variable name and selecting Change value. You can also select all or copy the value of the variable using the right-click menu.
Use the Referenced Tables view to examine data in tables and views referenced in the procedural object, and open the Table Data Editor to edit tables.
You can use the Debug view toolbar during a debug session to resume, suspend, or terminate execution of a procedural object. There are several ways to suspend or terminate execution of a procedural object during debugging. Use the one appropriate to your situation.
Icon | Action | Description | |
---|---|---|---|
| Suspend | Suspends execution between breakpoints or before the debug operation reaches the end of the procedure. | |
| Terminate | Terminates execution of the procedural object. | |
| Disconnect | Disconnects a client debugger from a remote debug target. See Debugging an External Client. | |
| Remove all terminated launches | Clears all terminated debug targets from the SQL Editor. | |
| Resume | Resumes a suspended thread. |
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com