Debugging an External Client

You can debug an external client using Sybase WorkSpace.

  1. In the Databases folder in Enterprise Explorer, under the database connection profile, expand the navigation tree for the appropriate database and schema owner.
    Database Steps
    From an ASE connection profile
    1. Expand the Databases folder.
    2. Expand the tree for a database and then the tree for the appropriate schema owner.
    From a SQL Anywhere or Sybase IQ connection profile
    1. Expand the tree for a database.
    2. Expand the Schemas folder and then the tree for the appropriate schema owner.
  2. Open the Database Development perspective.
  3. In Enterprise Explorer, open the procedural object.
  4. Find an existing procedural object.
    Procedural object Description
    Stored procedures Expand the Stored Procedures folder.
    SQL Anywhere or Sybase IQ User-defined functions Expand the User Defined Functions folder.
    Triggers Expand the Tables folder, select the table in which the trigger resides, and then expand the Triggers folder.
    SQL Anywhere or Sybase IQ events Expand the Events folder.
  5. Right-click the object and select Edit.
  6. In the Source page, set breakpoints.
  7. Select Window > Show View > Other > Sybase Database Debug > External Clients to open the External Clients view.
  8. Use the isql command line utility to connect to the database and determine the spid, or process identifier, of the connection:
    isql -U sa -P -S useridw2k
    1> select @@spid
    2> go
    ------
    24
    (1 row affected)
  9. In External Clients, expand the connection profile associated with the database to which the external client is connected.
  10. Right-click the client from which you want to debug and select Attach Client Connection for the spid matching that of your isql connection.
  11. From the client session, execute the procedural object you opened.
  12. Click Yes to switch to the Database Debug perspective.

    The client session is in a suspended state as the cursor is at the location of your first breakpoint.

  13. Debug the client using step-in, step-over, or resume in Debug.

    After debugging completes, the client session comes out of the suspended state as the cursor is at the location of your first breakpoint.

    Note: When you terminate the debugging session for an external client, the client connection is detached, but the client session remains. For example, if the client session is an isql session, terminating the debugging session detaches the isql session from the debugging tool, but the isql session is not terminated.
Related tasks
Debugging a Procedural Object
Dumping Debug Variables and Referenced Table Data
Debugging a Table in Referenced Tables View
Debugging a Trigger
Related reference
SQL Debugger Preferences


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com