- 1、本文档共14页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
年龄算法(Age algorithm)
年龄算法(Age algorithm)
function fun _ get _ nl (for _ csrq dates, to _ dqrq dates, as _ xz in varchar2) return varchar2 is
result varchar2 (50).
no _ months number;
no _ days number;
no _ year number.
d _ dqrq dates;
s _ xz varchar2 (20).
s _ nl varchar2 (50).
begin
if to _ csrq is null or to _ csrq = to _ dates (1900 - 1 - 1 , yyyy-mm-dd ) then
result: = ;
return (result);
end if;
if to _ dqrq is null or to _ dqrq = to _ dates (1900 - 1 - 1 , yyyy-mm-dd ) then
d _ dqrq: = sysdate;
else
d _ dqrq: = _ dqrq;
end if;
if as _ xz is null then
d = _ xz: banlsf;
else
s _ xz = as _ xz.
end if;
- 计算日数
select round (d _ dqrq - _ csrq) into n _ days from dual;
if no _ days 1 then
no _ days = 1;
end if;
- 计算年数
select to _ number (to _ char (d _ dqrq, yyyy) to _ number (to _ char (_ csrq, yyyy) into n _ year from dual;
if no _ year 0 then
no _ year: = 0;
end if;
- 联众病案系统年龄算法
if s _ xz = banlsf is then
select to _ number (to _ char (d _ dqrq, yyyy) * 12 + to _ number (to _ char (d _ dqrq, mm))
(to _ number (to _ char (_ csrq, yyyy) * 12 + to _ number (to _ char (_ csrq, mm))
into n _ months
from dual;
if no _ months 12 then
s _ nl = to _ char (trunc (n _ months / 12)) | |s 岁;
elsif n _ months 1 then
if no _ days 32 then
s _ nl = to _ char (trunc (n _ days) | |s 天;
else
s _ nl = to _ char (trunc (n _ months) | |s 个月;
end if;
else
s _ nl = to _ char (trunc (n _ days) | |s 天;
end if;
elsifs _ xz = xs is then
if no _ days 100 then
s _ nl = to _ char (trunc (n _ days) | |s 天;
elsif n _ days - 735 then
s _ nl = to _ char (trunc (n _ days / 30.5,0) | |s 个月;
else
s _ nl = to _ char (n _ year + 1) | |s 岁;
end if;
elsifs _ xz = xs1 is then
if no _ days 100 then
s _ nl = to _ char (trunc (n _ days) | |s 天;
elsif n _ days - 735 then
s _ nl = to _ char (trunc (n _ days / 30.5,0) | |s 个月;
else
if to _ char (_ csrq, mmdd) = to _ char (d _ dqrq, mmdd) then
s _ nl = to _ char (n _ year + 2) | |s 岁;
else
s _ nl = to _ char (n _ year + 1) | |s 岁;
end if;
end if;
elsifs _ xz = zs is then
if n
您可能关注的文档
- 利用优势限制竞争,在华跨国公司负面影响扩大(The use of advantages to limit competition, the negative impact of transnational corporations in China to expand).doc
- 利用次核心技术构建竞争优势(Using sub core technology to build competitive advantage).doc
- 利益平衡在司法中的适用领域和范围(The applicable fields and scope of interest balance in judicature).doc
- 前导词2(Heading 2).doc
- 剖解富士康为中国制造赋予人的尊严(Foxconn Chinese manufacturing anatomy gives us dignity).doc
- 剖析09年最抢手行业管理(Analysis of 09 years of the most sought after industry management).doc
- 力叉车液压系统的常见故障与维修方法(Common troubles and maintenance methods of hydraulic system of power fork lift truck).doc
- 努力发展县域经济 加快培植财源力度(Efforts should be made to develop county economy and speed up the cultivation of financial resources).doc
- 励志整理(Inspiring arrangement).doc
- 劳动法习题(Exercises in labor law).doc
- 四川省德阳市罗江中学2025届高三考前热身化学试卷含解析.doc
- 山东省枣庄现代实验学校2025届高三下学期第五次调研考试化学试题含解析.doc
- 吉林省长春市十一高中等九校教育联盟2025届高三一诊考试生物试卷含解析.doc
- 2025届江苏省盐城市伍佑中学高考仿真模拟化学试卷含解析.doc
- 2025届广西贺州中学高考冲刺押题(最后一卷)生物试卷含解析.doc
- 安徽省池州市贵池区2025届高三第一次模拟考试生物试卷含解析.doc
- 宁夏银川一中2025届高三(最后冲刺)化学试卷含解析.doc
- 广东省广州市增城区四校联考2025届高考压轴卷化学试卷含解析.doc
- 2025届邯郸市第一中学高考生物必刷试卷含解析.doc
- 2025届安徽省安庆市石化第一中学高考仿真卷化学试卷含解析.doc
文档评论(0)