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 » The SQL Anywhere debugger » Tutorial: Getting started with the debugger


Lesson 1: Starting the debugger and finding the bug

Start the debugger to run the debugger_tutorial stored procedure and find the bug.


This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Getting started with the debugger.

  1. Create the copy of the sample database that is used in this tutorial.

    1. Create a directory, for example c:\demodb, to hold the database.

    2. Run the following command to create the database:

      newdemo c:\demodb\demo.db
  2. Start Sybase Central. Click Start » Programs » SQL Anywhere 16 » Administration Tools » Sybase Central.

  3. In Sybase Central, connect to demo.db as follows:

    1. Click Connections » Connect With SQL Anywhere 16.

    2. In the Connect window, complete the following fields to connect to the database:

      1. In the User ID field, type DBA.

      2. In the Password field, type sql.

      3. In the Action dropdown list, select Start and connect to a database on this computer.

      4. In the Database file field, type c:\demodb\demo.db.

      5. In the Server name field, type demo_server.

    3. Click Connect.

  4. Click Mode » Debug.

  5. In the Which User Would You Like To Debug field, type * and then click OK.

    The Debugger Details pane appears at the bottom of Sybase Central and the Sybase Central toolbar displays a set of debugger tools.

    Specifying * allows you to debug all users. To change the user being debugged, you must exit and re-enter debug mode. When you provide a user ID, information for connections with that user ID is captured and appears on the Connections tab.

    The Debugger Details pane.
  6. In the left pane of Sybase Central, double-click Procedures & Functions.

  7. Right-click debugger_tutorial (GROUPO), and then click Execute from Interactive SQL.

    Interactive SQL opens and the following result set appears:

    top_company top_value
    (NULL) (NULL)

    This result set is incorrect. The remainder of the tutorial diagnoses the error that produced this result.

  8. Close any open Interactive SQL windows.


The debugger is started and a bug has been found in the debugger_tutorial stored procedure.


Proceed to Lesson 2: Diagnosing the bug.

 See also