创建存储过程:
CREATE procedure ordertotal( in onumber int, in taxable boolean, out ototal decimal(8,2) ) COMMENT 'Obtain order total,optionally adding tax' begin DECLARE total decimal(8,2); declare taxrate int DEFAULT 6; SELECT sum(item_price * quantity) from orderitems where order_num = onumber into total; if taxable then SELECT total+(total/100*taxrate) into total; end if; SELECT total into ototal;
end;
调用存储过程:taxable为真
call ordertotal(20005,1,@total);
SELECT @total;
调用存储过程:taxable为假
call ordertotal(20005,1,@total);
SELECT @total;
以上就是mysql智能存储过程的内容,更多相关内容请关注PHP中文网(www.php.cn)!
beta v1.1版本为第一个版本,简单的整合了基础功能,各位站长拿到程序后,不要纠结后台的功能简单,后续将不断更新扩展。在beta v1.1版本使用过程中遇到什么问题,请登录 www.loftto.com 进行反馈! 安装说明######重要提醒:程序不支持二级目录安装,请使用一级目录或二级目录绑定!#第一步,确定你的服务器支持PHP+mysql。#第二步,确定你的服务器开启了gd库。#第三步,
0
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号