时间:2021-07-01 10:21:17 帮助过:17人阅读
推荐(免费):mysql视频教程
文章目录
存储过程
1.创建存储过程并查看全局变量
mysql> create database yy;Query OK, 1 row affected (0.00 sec)mysql> use yy;Database changed mysql> set @num1=10,@num2=20,@num3=30; //设置全局变量mysql> delimiter $$ mysql> create procedure p(in num1 int,out num2 int,inout num3 int) -> begin -> select num1,num2,num3; -> set num1=100,num2=200,num3=300; -> select num1,num2,num3; -> end $$ Query OK, 0 rows affected (0.00 sec)mysql> delimiter ;mysql> call p(@num1,@num2,@num3);
总结1:
2.调用存储过程时全局变量值的变化
mysql> select @num1,@num2,@num3;
总结2:
以上就是总结MySQL存储过程in、out、inout参数示例的详细内容,更多请关注gxlcms其它相关文章!