有没有高手在,帮忙修改一下

这段程序,是个判断,总共有4种情况

当dctime=02,04,06,09,11时,to_number(dcNowMonth)-to_number(dcOldMonth)>100,则ntime:=1;
当dctime=05,07,08,10,12时,to_number(dcNowMonth)-to_number(dcOldMonth)>101,则ntime:=1;
当dctime=03时,to_number(dcNowMonth)-to_number(dcOldMonth)>103,则ntime:=1;
当dctime=01时,to_number(dcNowMonth)-to_number(dcOldMonth)>8900,则ntime:=1;

dcNowMonth:=to_char(sysdate,'yyyyMMdd');
   dctime:=to_char(sysdate,'MM');
   select dcmonth into dcOldMonth from month100 where rownum<2;
   while (dctime=02) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>100
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=04) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>100
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=06) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>100
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=09) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>100
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=11) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>100
   then
   ntime:=1;

   end if;
   end loop;
    while (dctime=03) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>103
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=01) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>8900
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=05) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>101
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=07) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>101
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=08) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>101
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=10) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>101
   then
   ntime:=1;
   end if;
   end loop;
    while (dctime=12) loop
   if to_number(dcNowMonth)-to_number(dcOldMonth)>101
   then
   ntime:=1;
   end if;
   end loop;

小弟对数据库的存储过程不熟,哪位帮我修改一下。还有
dctime:=to_char(sysdate,'MM');
是不是取系统日期中的月数。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值