In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to debug stored procedures in mysql. I hope you will gain a lot after reading this article. Let's discuss it together.
Mysql debug stored procedures: first, use a temporary table to record the debugging process; then directly in the stored procedure, add [select @ xxx], and view the results in the console.
The way mysql debugs stored procedures:
Calling stored procedures in navicat
1. Write statement call
The stored procedure above contains four parameters, so when calling here, you also need to pass four parameters: the input parameter fills in the value, and the output parameter represents @ resultselect @ result; as a variable-- this sentence displays the variable value on the console.
two。 Window click
Click the runtime directly and enter it in the pop-up input box:
'tasking factor, recording, writing, writing, etc.
Track the execution steps of the stored procedure
Unlike oracle, mysql does not have a plsqldevelper tool for debugging stored procedures, so there are two simple ways to track execution:
Record the debugging process with a temporary table
Directly in the stored procedure, add select @ xxx to view the results in the console:
For example, I added some query statements to the above stored procedure (notice the red statement below)
CREATE PROCEDURE `proomnextid` (kind_name VARCHAR (30), i_length int,currentSeqNo VARCHAR (3), OUT o_result INT) BEGIN SET @ a = NULL; SET @ b = NULL; SELECT id INTO @ a FROM t_seq WHERE number= currentSeqNo and length= i_length; SELECT @ a; IF (@ an is null) THEN select min (id) into @ a FROM t_seq where length= i_length Select number INTO @ b FROM t_seq WHERE id = @ a; select @ b; ELSE select number INTO @ b FROM t_seq WHERE id = @ astat1; END IF; SELECT @ b INTO o_result END finished reading this article, I believe you have a certain understanding of mysql debugging stored procedures, want to know more related knowledge, welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.