Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug a stored procedure in Toad?

Tags:

I have Oracle 10g installed and there is a package which has a number of cursors and procedures, how do I debug one of these procedures or cursors. Can you please provide steps for that? I ran a Google search but did not find anything specifying how to debug a particular procedure from a package.

like image 377
Sandeep Kumar Avatar asked Dec 05 '12 11:12

Sandeep Kumar


People also ask

How do I debug a stored procedure?

To debugging SP, go to database->Programmability->Stored Procedures-> right click the procedure you want to debug->select Debug Procedure.

Can we debug stored procedure in Oracle?

In Oracle, you can debug the following program units (PL/SQL programs): anonymous blocks, packages, procedures, functions, and triggers.

How do I view stored procedures in Toad?

In Toad, click on menu Database > Schema Browser. Select the Procedure from drop-down menu or from the Tab (if Schema Browser configured as Tab). Then list of procedures will be displayed for the current user. Then select a stored procedure and do the right click on it.


2 Answers

Basic Steps to Debug a Procedure in Toad

  1. Load your Procedure in Toad Editor.
  2. Put debug point on the line where you want to debug.See the first screenshot.
  3. Right click on the editor Execute->Execute PLSQL(Debugger).See the second screeshot.
  4. A window opens up,you need to select the procedure from the left side and pass parameters for that procedure and then click Execute.See the third screenshot.
  5. Now start your debugging check Debug-->Step Over...Add Watch etc.

Reference:Toad Debugger

Debug

Execute In Debug

parameter

like image 157
Gaurav Soni Avatar answered Nov 03 '22 21:11

Gaurav Soni


Open a PL/SQL object in the Editor.

Click on the main toolbar or select Session | Toggle Compiling with Debug. This enables debugging.

Compile the object on the database.

Select one of the following options on the Execute toolbar to begin debugging: Execute PL/SQL with debugger () Step over Step into Run to cursor

like image 39
Nikhil Reddy Avatar answered Nov 03 '22 21:11

Nikhil Reddy