Declare syntax error in MYSQL Workbench
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I declare and set a variable in my MYSQL WORKBENCH in a stored procedure? It gives a syntax error like unexpected Declare_sym at the first line with a cross sign. I am using the following code for it: Declare StartDate datetime set StartDate = '2013-07-01'; 回答1: After some googling, I got my answer. A Declare statement must be in between Begin and End statement. Additionally, it must be the first statement after the Begin statement. I got the answer from this wonderful site. 文章来源: Declare syntax error in MYSQL Workbench