您的位置:首页 > 数据库 > MySQL

MySQL 存储过程相互调用举例

2017-02-07 00:58 323 查看
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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: