大家好,又见面了,我是你们的朋友全栈君。
创建函数的基本格式 create or replace function 函数名称(参数1 ,参数2) return 参数类型 is
create or replace function getPreferentialPrice (priceRet in number,clientId in varchar2,dd_outp_class in varchar2) return number is ret number; type2 varchar2(20); rate number := 1.0; begin select b.DD_FEESOURCE_TYPE into type2 from EHR_CLI_REGISTRY a,EHR_FEESOURCE_ATTR b where a.ehr_id=b.ehr_id and a.CLIENT_ID=clientId ; if type2 = ‘2’ then if dd_outp_class = ’05’ then rate := 0.9 ; elsif dd_outp_class = ’08’ then rate := 0.95 ; elsif dd_outp_class = ’11’ then rate := 0.5 ; end if; end if; ret := priceRet*rate; return (to_char(ret,’9999999990.99′) ); end getPreferentialPrice;
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/160741.html原文链接:https://javaforall.cn
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有