Contents Index Start the debugger Run the debugger_tutorial procedure

ASA SQL User's Guide
  Debugging Logic in the Database
    Tutorial: Getting started with the debugger

Lesson 2: Debug a stored procedure


This tutorial describes a sample session for debugging a stored procedure. It is a continuation of Lesson 1: Connect to a database and start the debugger.

This tutorial illustrates how to use the debugger to identify errors in stored procedures. To set the stage, you introduce a deliberate error into the stored procedure debugger_tutorial, which is part of the sample database.

The debugger_tutorial procedure should return a result set that contains the name of the company that has placed the highest value of orders, and the value of their orders. It computes these values by looping over the result set of a query that lists companies and orders. (This result could be achieved without adding the logic into the procedure, by using a SELECT FIRST query. The procedure is used to create a convenient example.) The procedure has an intentional bug in it. In this tutorial you diagnose and fix the bug.


Run the debugger_tutorial procedure
Diagnose the bug
Confirm the diagnosis and fix the bug

Contents Index Start the debugger Run the debugger_tutorial procedure