oracle生产.jio格式,oracle 新的数据库新的change

--本游标是处理   declare     cursor c is       select JIOYRQ,              tjjgh,              TJGY,              bxgs,              sum(jioyje) jioyjesum,              count(tbdh) tbdhsum         from bx_mir_dsmx        WHERE jioyrq = V_SYSDAT        group by JIOYRQ, TJGY, tjjgh, bxgs;     v_jioyrq    t_ls2_tj020_01.jioyrq%type;     v_tjjgh     t_ls2_tj020_01.tjjgh%type;     v_TJGY      T_LS2_TJ020_01.TJGY%type;     v_bxgs      t_ls2_tj020_01.bxgs%type;     V_JIOYJESUM T_LS2_tj020_01.JIOYJESUM%TYPE;     V_TBDHSUM   T_LS2_tj020_01.TBDHSUM%TYPE;     /*cursor p is     select count(*) khsum from           (select distinct tbr,lxdh from bx_mir_dsmx where jioyrq=v_jioyrq and                   TJGY=v_TJGY and bxgs=v_bxgs);*/     v_khsum t_ls2_tj020_01.khsum%type;   begin     open c;     loop       fetch c         into v_jioyrq, v_tjjgh, v_TJGY, v_bxgs, V_JIOYJESUM, V_TBDHSUM;       exit when c%notfound;       --open p;       --fetch p into v_khsum;       --exit when p%notfound;       select count(*)         into v_khsum         from (select distinct tbr, lxdh                 from bx_mir_dsmx                where jioyrq = v_jioyrq                  and TJGY = v_TJGY                  and bxgs = v_bxgs);       insert into t_ls2_tj020_01         (jioyrq, TJGY, TJJGH, BXGS, JIOYJESUM, TBDHSUM, khsum)       values         (v_jioyrq,          v_TJGY,          v_tjjgh,          v_bxgs,          V_JIOYJESUM,          V_TBDHSUM,          v_khsum);       commit;       --close p;     end loop;     close c;   end;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值