本文介绍了在MYSQL Workbench中声明语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在存储过程的MYSQL WORKBENCH
中声明和设置变量?
How can I declare and set a variable in my MYSQL WORKBENCH
in a stored procedure?
第一行带有叉号的语法错误类似于unexpected Declare_sym
.
It gives a syntax error like unexpected Declare_sym
at the first line with a cross sign.
我正在使用以下代码:
Declare StartDate datetime
set StartDate = '2013-07-01';
推荐答案
经过一番谷歌搜索后,我得到了答案.
After some googling, I got my answer.
Declare
语句必须位于Begin
和End
语句之间.此外,它必须是Begin
语句之后的第一条语句.
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.
这篇关于在MYSQL Workbench中声明语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!