V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Fankinl
V2EX  ?  Oracle

小白请教各位大神 Oracle 里 循环游标 Cursor_1 时里边再循环一个游标 Cursor_2,发现 Cursor_2 里的数据不对

  •  
  •   Fankinl · 2020-03-29 17:18:14 +08:00 · 1693 次点击
    这是一个创建于 1503 天前的主题,其中的信息可能已经有所发展或是发生改变。

    腾讯云最新优惠活动来了:云产品限时1折,云服务器低至88元/年 ,点击这里立即抢购:9i0i.cn/qcloud,更有2860元代金券免费领取,付款直接抵现金用,点击这里立即领取:9i0i.cn/qcloudquan

    (福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

    v_count number; A number; B number; C number;

    A:=1; B:=1; C:=1;

    cursor Cursor_2(A number, B number, C number) is select * from table1 tt where tt.A = A and tt.B = B and tt.C = C;

    for cur_1 in Cursor_1 loop select count(1) into v_count from table1 tt where tt.A = A and tt.B = B and tt.C = C; if(v_count > 0 ) then for cur_2 in Cursor_2(A, B, C) loop -- ToDo end loop; end if; end loop;

    --- 以上是简单的一段类似 Sql ---

    其中我断点看过 v_count == 1, 但是在第二个循环里头断点发现循环了两遍,Cursor2 游标的数据好像跟传入参数所查询出来的不一样,这个不太很明白情况 有没有大神可以指导一下呢?

    1 条回复  ?  2020-03-29 17:19:05 +08:00
    Fankinl
        1
    Fankinl  
    OP
       2020-03-29 17:19:05 +08:00
    编辑的时候还能换行,已发布帖子就没有换行了?囧囧囧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5368 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:54 · PVG 15:54 · LAX 00:54 · JFK 03:54
    Developed with CodeLauncher
    ? Do have faith in what you're doing.


    http://www.vxiaotou.com