前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >oracle 函数 如何编写

oracle 函数 如何编写

作者头像
全栈程序员站长
发布于 2022-09-09 07:30:44
发布于 2022-09-09 07:30:44
4950
举报

大家好,又见面了,我是你们的朋友全栈君。

创建函数的基本格式 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

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
💥开发者 MCP广场重磅上线!
精选全网热门MCP server,让你的AI更好用 🚀
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档