加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle 存储过程(其中使用了游标)例子

发布时间:2020-12-12 15:28:45 所属栏目:百科 来源:网络整理
导读:create or replace procedure PRC_analysis_alert is ---获得“预警研判分析-预警信息统计”结果 的游标 cursor CRS_AlERT is select xzqh,zzjgdm,yjlx,substr(TJRQ,1,6) tjyf,clzt,sum(yjsl) yjsl from t_pvbdp_statistics_alert group by xzqh,6),clzt ;be
create or replace procedure PRC_analysis_alert is

  ---获得“预警研判分析-预警信息统计”结果 的游标
  cursor CRS_AlERT is
     select xzqh,zzjgdm,yjlx,substr(TJRQ,1,6) tjyf,clzt,sum(yjsl) yjsl
     from t_pvbdp_statistics_alert group by  xzqh,6),clzt ;

begin
  ----预警研判分析 - 预警信息统计
  execute immediate 'truncate table t_pvbdp_analysis_alert' ; 
  for alert_msg in CRS_AlERT loop 
    begin
      insert into t_pvbdp_analysis_alert
        (id,tjyf,xzqh,yjsl)
      values
        (sys_guid(),alert_msg.tjyf,alert_msg.xzqh,alert_msg.zzjgdm,alert_msg.yjlx,alert_msg.clzt,alert_msg.yjsl);
    end;
  end loop;

end PRC_analysis_alert;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读