pb用游标查询为什么只有最后一个能查到
DECLARErbCURSORFORSELECTbidFROMjieshuwhererid=:lsrid;Openrb;//打开游标//提取数据FETCHrbinto:l...
DECLARE rb CURSOR FOR
SELECT bid
FROM jieshu
where rid=:lsrid;
Open rb;//打开游标
//提取数据
FETCH rb into :lsbid;
DO WHILE sqlca.sqlcode=0
//将读取的数据加到listbox中
select bname into :lsbname
from book
where bid=:lsbid;
lb_1.additem(lsbid+lsbname)
FETCH rb into :lsbid;
LOOP
close rb;//关闭游标
输出结果是
00001
00002
00003 10003
我设置断点发现中间的查询都为空 展开
SELECT bid
FROM jieshu
where rid=:lsrid;
Open rb;//打开游标
//提取数据
FETCH rb into :lsbid;
DO WHILE sqlca.sqlcode=0
//将读取的数据加到listbox中
select bname into :lsbname
from book
where bid=:lsbid;
lb_1.additem(lsbid+lsbname)
FETCH rb into :lsbid;
LOOP
close rb;//关闭游标
输出结果是
00001
00002
00003 10003
我设置断点发现中间的查询都为空 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询