oracle使用游标插入数据,游标中我怎样才能实现循环插入数据呢???

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

declare cursor userinfo_cur is

select distinct upper(substr(t.report_name,1,(case when instr(t.report_name,' ')=0 then length(t.report_name)

else instr(t.report_name,' ')-1 end)))

from eip_meta_detail_etl_MWW t;

begin

FOR userinfo_rec in userinfo_cur

loop

CREATE OR REPLACE VIEW V_EIP_META_DETAIL_ETL_YX_MWW AS

SELECT distinct E.Child_Id,

(case when LEVEL=1 then '|_'||E.REPORT_NAME

when LEVEL=2 then ' |__'||E.REPORT_NAME

when LEVEL=3 then ' |__'||E.REPORT_NAME

when LEVEL=4 then ' |__'||E.REPORT_NAME

when LEVEL=5 then ' |__'||E.REPORT_NAME

when LEVEL=6 then ' |__'||E.REPORT_NAME

when LEVEL=7 then ' |__'||E.REPORT_NAME

when LEVEL=8 then ' |__'||E.REPORT_NAME

when LEVEL=9 then ' |__'||E.REPORT_NAME

when LEVEL=10 then ' |__'||E.REPORT_NAME

when LEVEL=11 then ' |__'||E.REPORT_NAME

when LEVEL=12 then ' |__'||E.REPORT_NAME

when LEVEL=13 then ' |__'||E.REPORT_NAME

when LEVEL=14 then ' |__'||E.REPORT_NAME

when LEVEL=15 then ' |__'||E.REPORT_NAME

when LEVEL=16 then ' |__'||E.REPORT_NAME

end ) as EREPORT_NAME,

E.Father_Id, E.REPORT_NAME,E.NAME,E.TABLE_SOURCE,E.REPORT_SOURCE, E.RELATION,E.REF_COL1,E.REF_COL2||E.REF_COL3 AS REF_COL3,REF_COL4||REF_COL5||REF_COL6 AS REF_COL6,E.REMARK,LEVEL as bi_level

FROM eip_meta_detail_etl_MWW E

START WITH E.Child_Id in (select Child_Id from v_eip_meta_detail_etl_MWW t

where REPORT_NAME like 'userinfo_rec')

CONNECT BY PRIOR E.Father_Id=E.Child_Id

order by 'A'||Child_Id desc;

end loop;

end;

这是一段plsql,那位大神帮忙指导一下怎么才能成功把

select distinct upper(substr(t.report_name,1,(case when instr(t.report_name,' ')=0 then length(t.report_name)

else instr(t.report_name,' ')-1 end)))

from eip_meta_detail_etl_MWW t;

所找出的唯一的report_name根据一定的逻辑插入一张表中

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值