In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about how to solve errors in the creation of stored procedures in MySQL. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
Mysql > delimiter $$
Mysql > CREATE FUNCTION check_rollbackPatch (THE_REFERNCE_LABEL VARCHAR 75), THE_COLUMN_NAME VARCHAR 75, THE_INSTALL_VERSION VARCHAR 75, THE_VERSION_LEVEL_TABLE_NAME VARCHAR 75)
-> RETURNS INTEGER DETERMINISTIC
-> BEGIN
-> DECLARE INSTALL_VERSION VARCHAR (80) DEFAULT NULL
-> DECLARE REFERENCE_LABEL VARCHAR (80) DEFAULT NULL
-> DECLARE THE_QUERY VARCHAR (500) DEFAULT NULL
-> DECLARE too_many_rows CONDITION FOR 1172
-> DECLARE CONTINUE HANDLER FOR too_many_rows
-> BEGIN
-> SELECT concat ('[INFO] Several', THE_REFERNCE_LABEL, 'references found.')
-> RETURN 0
-> END
-> DECLARE CONTINUE HANDLER FOR NOT FOUND
-> BEGIN
-> / * SELECT concat ('[INFO]', THE_REFERNCE_LABEL, 'reference not found.'); * /
-> RETURN 1
-> END
-> SELECT concat (', THE_COLUMN_NAME,') INTO @ V_PART1
-> SELECT concat (THE_COLUMN_NAME,'=', THE_REFERNCE_LABEL,') INTO @ V_PART2, THE_INSTALL_VERSION,'') INTO @ V_PART2
-> SELECT format_selectQuery (THE_VERSION_LEVEL_TABLE_NAME, @ V_PART1, @ V_PART2) INTO THE_QUERY
-> / * SELECT concat ('[INFO] The query to execute is [', THE_QUERY,']); * /
-> / * EXECUTE IMMEDIATE THE_QUERY into REFERENCE_LABEL, INSTALL_VERSION;*/
-> / * SELECT concat ('[INFO]', THE_REFERNCE_LABEL, 'reference found'); * /
-> RETURN 0
-> END $$
ERROR 1415 (0A000): Not allowed to return a result set from a function
Mysql > delimiter
Reason for reporting an error:
In the function of MySQL, you cannot use the select statement to return the result set, and an error will be reported.
After commenting out, the error disappeared.
Mysql > delimiter $$
Mysql > CREATE FUNCTION check_rollbackPatch (THE_REFERNCE_LABEL VARCHAR 75), THE_COLUMN_NAME VARCHAR 75, THE_INSTALL_VERSION VARCHAR 75, THE_VERSION_LEVEL_TABLE_NAME VARCHAR 75)
-> RETURNS INTEGER DETERMINISTIC
-> BEGIN
-> DECLARE INSTALL_VERSION VARCHAR (80) DEFAULT NULL
-> DECLARE REFERENCE_LABEL VARCHAR (80) DEFAULT NULL
-> DECLARE THE_QUERY VARCHAR (500) DEFAULT NULL
-> DECLARE too_many_rows CONDITION FOR 1172
-> DECLARE CONTINUE HANDLER FOR too_many_rows
-> BEGIN
-> / * SELECT concat ('[INFO] Several', THE_REFERNCE_LABEL, 'references found.'); * /
-> RETURN 0
-> END
-> DECLARE CONTINUE HANDLER FOR NOT FOUND
-> BEGIN
-> / * SELECT concat ('[INFO]', THE_REFERNCE_LABEL, 'reference not found.'); * /
-> RETURN 1
-> END
-> SELECT concat (', THE_COLUMN_NAME,') INTO @ V_PART1
-> SELECT concat (THE_COLUMN_NAME,'=', THE_REFERNCE_LABEL,') INTO @ V_PART2, THE_INSTALL_VERSION,'') INTO @ V_PART2
-> SELECT format_selectQuery (THE_VERSION_LEVEL_TABLE_NAME, @ V_PART1, @ V_PART2) INTO THE_QUERY
-> / * SELECT concat ('[INFO] The query to execute is [', THE_QUERY,']); * /
-> / * EXECUTE IMMEDIATE THE_QUERY into REFERENCE_LABEL, INSTALL_VERSION;*/
-> / * SELECT concat ('[INFO]', THE_REFERNCE_LABEL, 'reference found'); * /
-> RETURN 0
-> END $$
Query OK, 0 rows affected (0.00 sec)
Mysql > delimiter
The above is how to solve the error report in the creation of stored procedures in MySQL shared by Xiaobian. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.