论坛首页 综合技术论坛

oracle 存储过程中循环条件为每月的天数

浏览 4052 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2010-01-26  
请问各位老鸟

         在oracle 存储过程中,如果循环条件为每月的天数,应该怎么处理啊??
      


                 无解中 
   发表时间:2010-01-27  
这是我自己写的,如有不当,也请高手指出!
Declare
V_day integer;
Begin
Select to_char(last_day(sysdate), ‘dd’) into v_day from dual;
For v_i in 1..v_day loop
              --循环体
End loop;
End;
0 请登录后投票
   发表时间:2010-01-27  
babywolf 写道
这是我自己写的,如有不当,也请高手指出!
Declare
V_day integer;
Begin
Select to_char(last_day(sysdate), ‘dd’) into v_day from dual;
For v_i in 1..v_day loop
              --循环体
End loop;
End;


             非常感谢!!
            问题解决了!!
    循环体是调用别的存储过程,嵌套的循环太多

       最后运行起来102s
哎!!
          这效率。。。。。。
0 请登录后投票
   发表时间:2010-01-28  
MySpace 写道
babywolf 写道
这是我自己写的,如有不当,也请高手指出!
Declare
V_day integer;
Begin
Select to_char(last_day(sysdate), ‘dd’) into v_day from dual;
For v_i in 1..v_day loop
              --循环体
End loop;
End;


             非常感谢!!
            问题解决了!!
    循环体是调用别的存储过程,嵌套的循环太多

       最后运行起来102s
哎!!
          这效率。。。。。。

思路反过来,定一个JOB,每天执行这个过程不就可以了吗
0 请登录后投票
   发表时间:2010-01-29  
这个需求没看明白
0 请登录后投票
论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics