MySQL 存储过程相互调用举例

来源:互联网 发布:linux 模糊查找文件 编辑:程序博客网 时间:2024/06/09 18:56
create procedure prccharges(in orderno char(6),out shippingCharges float(4,2),out wrapCharges float(4,2))   begin    select mshippingcharges into shippingCharges from orders where corderno = orderno;    select mgiftwrapcharges into wrapcharges from orders where corderno = orderno;   end;create procedure prcHandLingCharges(in orderno char(6),out handlingCharges float(4,2))   begin    declare ppp float(4,2);    declare qqq float(4,2);    call prccharges(no,p,q);     set handlingCharges = p+ q;   end;



上面的例子调用方法
call prcHandLingCharges('1',@af);select @af;



0 0
原创粉丝点击