存储过程带返回参数

存储过程带返回参数

IN 的是输入参数,out的是要输出的参数
===存储过程代码
BEGIN DECLARE v_countGC int; DECLARE v_GCCountHold int; DECLARE v_GCIDHold int; DECLARE v_skuIDHold int; DECLARE v_onPlace varchar(50); select count(GCID),skuID,onPlace,GCCount,GCID into v_countGC,v_skuIDHold,v_onPlace,v_GCCountHold,v_GCIDHold from globalContainer where CBid = p_CBidHold; set r_GCCountHold = v_GCCountHold; set r_GCIDHold = v_GCIDHold; if v_countGC!=0 then if v_onPlace = '' or v_onPlace is null then if p_skuID = v_skuIDHold then set v_useableBox = 2; else set v_useableBox = 1; end if; else set v_useableBox = 0; end if; else set v_useableBox = 1; end if; select v_useableBox; END ======调用该存储过程===========
 
CALL useableBox(v_CBidHold, v_skuID,v_useableBox,v_GCCountHold,v_GCIDHold); 
定义三个变量:v_useableBox,v_GCCountHold,v_GCIDHold用于接收存储过程的输出参数

你可能感兴趣的:(存储过程带返回参数)