Debugging Oracle Stored Procedures

Source: Internet
Author: User

1. Open PL/SQL Developer

If PL/SQL developer is installed on the machine, open the PL/SQL Developer interface

Enter the user name, password, and host name, which is exactly the same as configured in Web. config in the program, click OK

Locate the package bodies that contains the stored procedure that you want to debug, such as Pack_activity, right-click, select [view] in the pop-up menu, and get all the stored procedures and their code in the package.

2. Adding debug information

To be able to step through the stored procedure, you need to add debug information for the package it is in, right-click the package you want to debug, and select [Add Debug Info] in the popup menu.

This adds debugging information to the package body.

3. Debugging Stored Procedures

Now that all the preparation is done, you can debug the trace stored procedure.

Select the stored procedure you want to debug, right-click, select [Test] in the pop-up menu and go to the test window. The test window has the code to test the stored procedure automatically, and of course you can add and modify the code yourself, which is enough for us to debug the stored procedure. Then follow the steps below to debug.

(1) To add the parameters required for the stored procedure, most of the stored procedures in our project require parameters, and the parameters can be entered in the lower right part of the test window.

such as: getpanno_new need an input parameter V_employeeid, we enter 180, the output parameter is MyCursor, is to view the result, do not need to enter any value.

(2) Start debugging, click [Debug] Menu->[start] (or press F9), go in debug mode, the program began to stop at the begin line.

(3) After the commissioning process and we are familiar with the debugging process is the same:

Run (CTRL+R)

Single Step entry (CTRL + N)

Single Step Skip (Ctrl+o)

Single Step Exit (Ctrl+t)

or click the button on the Debug toolbar: When you press CTRL + N to enter the source code of the stored procedure

In this window, you can view the values and stacks of variables in the procedure.

(4) After the commissioning run, you can view the results as follows (click the button next to the MyCursor variable).

Debugging Oracle Stored Procedures

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.