mysql DECLARE WHILE外的存储过程如何? [英] mysql DECLARE WHILE outside stored procedure how?

查看:78
本文介绍了mysql DECLARE WHILE外的存储过程如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对mysql还是很陌生,但是有MS SQL经验.

I fairly new to mysql but have MS SQL experience.

是否可以声明变量并使用 while 语句 存储过程之外?

Is it possible to declare variables and use while statement outside stored procedure?

我只发现了这样的例子

1. procedure created
2. execute proc
3. drop proc

建议我正确的方式

推荐答案

否,您不能这样做.您只能在BEGIN ... END子句中使用这些语句.

No, you cannot do it. You can use these statements only inside BEGIN...END clause.

因此,在存储过程/函数,触发器和事件中都是可能的.

So, it is possible in stored procedures/functions, triggers and events.

此处的更多信息- MySQL复合语句语法.

这篇关于mysql DECLARE WHILE外的存储过程如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆