时间:2018-03-30 00:25:57
过程1:带返回值:
drop procedure if exists proc_addNum;
create procedure proc_addNum (in x int,in y int,out sum int)
BEGIN
SET sum= x + y;
end
然后,执行过程,out输出返回值:
call proc_addNum(2,3,@sum);
select @sum;
过程2:不带返回值:
drop procedure if exists proc_addNum;
create procedure proc_addNum (in x int,in y int)
BEGIN
DECLARE sum int;
SET sum= x + y;
SELECT sum;
end
执行过程:
call proc_addNum(2,3);
标签:不带,int,sum,addNum,Mysql,返回值,proc,procedure
From: https://blog.csdn.net/springdk2009/article/details/136832656