oracle循环执行存储过程,指定循环日期区间
·
1、功能:存储过程中for循环调用存储过程
2、场景:跑历史数据
create or replace procedure sp_loop_run is
Cursor datekeey is
select to_number(to_char(datekeey,'yyyyMMdd')) datekeey
from (select
date'2021-01-01' + (rownum - 1) datekeey
from dual connect by rownum <= (date'2021-06-30' - date'2021-01-01' + 1))
order by datekeey; --从xx到xx遍历日期
i number;
begin
for i in datekeey LOOP
begin
sp_pub_fund_quo_adj(i.datekeey); --调用存储过程
end;
end LOOP;
commit;
end sp_loop_run;
参考地址:https://blog.csdn.net/shammy_feng/article/details/124475214
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)