This is the 28th day of my participation in the Gwen Challenge in November. Check out the details: The last Gwen Challenge in 2021.”

❤️ About the author: Hello everyone, I am Xiao Xu Zhu. Java field quality creator 🏆, CSDN blog expert certification 🏆, Huawei Cloud enjoy expert certification 🏆

❤️ technology live, the appreciation

❤️ like 👍 collect ⭐ look again, form a habit


The process of debugging Oracle stored procedures or functions

The first step:

Select Debug Mode

Find the function or stored procedure to be debugged under the database functions package, then select the function (or stored procedure), right click, as shown in the picture below, select the test function and enter debugging mode.

 

The second step:

Input test data

 

 

 

 

Step 3:

Click Start debugger

 

 

Step 4:

Enter the name of the variable to display

 

The variable name to be entered can be the input parameter name, or the variable name in the function or stored procedure. By observing the change of the variable value, it is convenient for debugging.

 

Step 5:

 

Click single-step debug

 

Step 6:

Step by step click on the single step debug and see the changes in the variables

 

 

Step 7:

Repeat the first six steps until the function or stored procedure debugging is complete.

Debugging of mysql stored procedures or functions

Mysql doesn’t have the plsqlDeveloper tool to debug stored procedures, so there are several simple ways to track the execution:

1. Use a temporary table to record the debugging process;

Add select XXX to the stored procedure and check the result on the console:

Copy the stored procedure SQL into the Navicat query, then SET @num uses the custom variable.

 

In actual application scenarios, all three methods can be used and combined with different scenarios.

Method 1 applies to multiple data processing, and the processing result cannot be stored by variables.

Method 2 applies to general stored procedures and views the results.

Method 3 applies to stored procedures that need to be optimized step by step. Execute the stored procedure SQL statement for each step. But stored procedures can’t be tested for breakpoints, so you can handle it this way.