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

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 游标的数据好像跟传入参数所查询出来的不一样,这个不太很明白情况 有没有大神可以指导一下呢?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值