過程1:帶返回值: 然後,執行過程,out輸出返回值: 過程2:不帶返回值: 執行過程: ...
過程1:帶返回值:
1 drop procedure if exists proc_addNum; 2 create procedure proc_addNum (in x int,in y int,out sum int) 3 BEGIN 4 SET sum= x + y; 5 end
然後,執行過程,out輸出返回值:
1 call proc_addNum(2,3,@sum); 2 select @sum;
過程2:不帶返回值:
1 drop procedure if exists proc_addNum; 2 create procedure proc_addNum (in x int,in y int) 3 BEGIN 4 DECLARE sum int; 5 SET sum= x + y; 6 SELECT sum; 7 end
執行過程:
1 call proc_addNum(2,3);