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

WeChat public account
Shulou
2025-10-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the MySQL creation function Times error 'ERROR 1336 (0A000): how to do Dynamic SQL', the article introduces in great detail, has a certain reference value, interested friends must read it!
Error creating function Times
Mysql > delimiter $$
Mysql > CREATE FUNCTION is_SQLScriptReferenceExist (THE_REFERENCE VARCHAR (75), THE_VERSION_LEVEL_TABLE_NAME VARCHAR (75)) RETURNS INTEGER DETERMINISTIC
-> BEGIN
DECLARE THE_REFERENCE_LABEL VARCHAR (80)
-> DECLARE CONTINUE HANDLER FOR NOT FOUND
-> BEGIN
-> RETURN 0
-> END
-> SELECT concat ('select c_reference_label INTO THE_REFERENCE_LABEL from', THE_VERSION_LEVEL_TABLE_NAME, 'where C_REFERENCE_LABEL ='', THE_REFERENCE,') INTO @ stmt
-> PREPARE STMT FROM @ stmt
-> EXECUTE STMT
-> / * select c_reference_label into THE_REFERENCE_LABEL from THE_VERSION_LEVEL_TABLE_NAME where C_REFERENCE_LABEL = THE_REFERENCE; * /
-> RETURN 1
-> END$$
ERROR 1336 (0A000): Dynamic SQL is not allowed in stored function or trigger
Mysql > delimiter
Reason for reporting an error:
Dynamic functions are not allowed in MySQL functions and triggers
Can be rewritten into a stored procedure
Mysql > delimiter $$
Mysql > CREATE PROCEDURE is_SQLScriptReferenceExist (IN THE_REFERENCE VARCHAR (75), IN THE_VERSION_LEVEL_TABLE_NAME VARCHAR (75), OUT V_RET INT (2))
-> BEGIN
DECLARE THE_REFERENCE_LABEL VARCHAR (80)
-> DECLARE CONTINUE HANDLER FOR NOT FOUND
-> BEGIN
-> SET V_RET = 0
-> END
-> SELECT concat ('select c_reference_label INTO THE_REFERENCE_LABEL from', THE_VERSION_LEVEL_TABLE_NAME, 'where C_REFERENCE_LABEL ='', THE_REFERENCE,') INTO @ stmt
-> PREPARE STMT FROM @ stmt
-> EXECUTE STMT
-> / * select c_reference_label into THE_REFERENCE_LABEL from THE_VERSION_LEVEL_TABLE_NAME where C_REFERENCE_LABEL = THE_REFERENCE; * /
-> SET V_RET = 1
-> END$$
Query OK, 0 rows affected (0.00 sec)
Mysql > delimiter
The above is all the contents of the article "MySQL creation function Times error 'ERROR 1336 (0A000): what to do with Dynamic SQL'". Thank you for reading! Hope to share the content to help you, more related knowledge, 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.