当游标自动执行到最后数据时?
kimcz 2003-01-14 01:58:04 ...
declare aaa_cursor cursor for
select a1, a2 from tb1
do while sqlca.code = 0
fetch aaa_cursor into :a1, :a2
b1 = a1
b2 = a2
当运行到最后数据时
b1 = a2
b2 = a1
loop
怎么知道游标自动运行到最后数据?
我不想用下面方法
select count(*) into :ll_count from tb1
for i =1 to ll_count
fetch aaa_cursor into :a1, :a2
if i < ll_count then
b1 = a1
b2 = a2
else
b1 = a2
b2 = a1
end if
loop