ORACLE利用游标批量插入


begin
  for cr in (
select 
       x03.xsddhm
  from xst03 x03
  left join kct98 t98
    on t98.xsddhm = x03.xsddhm
  left join kcm07 m7
    on t98.kccxdm = m7.kccxdm
   and t98.kcppai = m7.kcppai
  left join kcm05 m5
    on m7.kcxlie = m5.kcxlie
   and m7.kcppai = m5.kcppai
  left join xst34 x34
    on x03.xsddhm = x34.xskhdd
  left join xsm12 m12
    on x03.xsjslx = m12.xsjsdm
 where 1 = 1
   and x03.xsddzt in ('F', 'G')
   and x03.xspczt = 'C'
   and x34.xspzph is null
   and m12.xszjlx = 'ZS'
   and x03.kcppai = 'ORV'
   and x03.xspcrq > 20140602
   AND t98.kcckrq<20190601 )
loop 
  insert into xst34 values ('00',cr.xsddhm,null,null);
  end loop;
  commit;
  end;

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM