Debug oracle stored procedures in PL/SQL Developer.

Source: Internet
Author: User

Debug oracle stored procedures in PL/SQL Developer.
Author: iamlaosong

Alas, in the real world, I used Toad and used dbms_output.put_line to debug the stored procedure. I only thought it was inconvenient. After PL/SQL Developer was used, I still used this method habitually. People all had inertia. It is inconvenient to analyze the data generated by the stored procedure today. I searched the internet to find out how to debug the stored procedure of oracle in PL/SQL Developer. I know how to use the debugging function of PL/SQL Developer. for compiling complex stored procedures, packages, funtion... it is very helpful. It is also useful to analyze the results of the stored procedure. After learning it, it is really convenient, and the relevant steps are extracted as follows:

1. The first step is to write the stored procedure and the compilation is correct;
2. Add the debug information. To be able to track stored procedures in one step, you need to add debug information for the package where the stored procedure is located. Right-click the name of the stored procedure to be debugged and select [add debug information] in the pop-up menu. in this way, debugging information is added to the package body;

3. Select the name of the stored procedure to be debugged, right-click it, and select [Test] from the pop-up menu. The Test window contains the code automatically generated to Test the stored procedure, of course, you can also add and modify the code by yourself. The automatically generated code is enough.

begin  -- Call the procedure  sxjk_sn_jsgfl(pinput => :pinput);end;

4. For a stored procedure with parameters, enter the parameter values in the following parameter input table. For details, see "n ".


5. Start debugging. Click the Start icon on the toolbar or press F9 to enter the debugging mode. The debugging process will be the same as the debugging process we are familiar with (below are some debugging functions on the menu or toolbar ):
Run (Ctrl + R) at full speed to stop at the breakpoint;
Step into (Ctrl + N): execute one Step. If it is a call process, enter the sub-process;
Step over (Ctrl + O) execute one Step, No matter what statement;
Step out (Ctrl + T) is executed until the process exits to the upper level;
......
6. You can set a breakpoint during the debugging process (click the gray margin on the left of the breakpoint statement and a Red Cross will appear, indicating that the breakpoint can be canceled again ), you can view the variable value during the process (the system automatically displays the variable value when you point to the variable ).


If you cannot perform the task in one step or set a breakpoint, you may not have done so in step 2 [add debug information.
How Does Oracle official software SQL developer perform one-step debugging on a package and PL/SQL?

1. Right-click to open a package
2. Find the method you want to debug in the package and left-click your breakpoint in the Method Content
3. right-click your method and select a TEST line selection to go to your debugging page. Enter the parameters of the stored procedure or function below and click start debugger in the upper left corner to start debugging.

If you don't understand me, give me your email and I'll send it to you.

Can windows forms be called during oracle stored procedures executed by PLSQL Developer?

In my experience using plsql, it cannot be seen. If you want to call a windows form when executing a stored procedure, you can use a programming language, such as C # and java, as a front-end, and then use the front-end to call the database, but this is complicated.
 

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: info-contact@alibabacloud.com 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.