您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

MySQL存储过程中如何使用用户变量?

2025/5/29 10:21:10发布15次查看
在 mysql 存储过程中,用户变量通过与号(即 @)引用,并以用户变量名称为前缀。例如@a、@b等都是用户变量。为了演示它,我们正在创建以下过程 -
mysql> delimiter // ;mysql> create procedure proc_uservariables() -> begin -> set @a = 100; -> set @b = 500; -> select @a,@b,@a+@b; -> end //query ok, 0 rows affected (0.00 sec)mysql> delimiter ; //mysql> call proc_uservariables();+------+------+-------+| @a | @b | @a+@b |+------+------+-------+| 100 | 500 | 600 |+------+------+-------+1 row in set (0.00 sec)query ok, 0 rows affected (0.01 sec)
以上就是mysql存储过程中如何使用用户变量?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product