fetch读出的数据正确,但是更新操作只有最后一行数据更新,为什么
Cain0 2009-01-02 06:11:59 fetch读出的数据正确(fetch每次读出的数据是所期望的sale表中的商品号码),但是更新goods_2表操作只有最后一行数据更新,实在不知道为什么了
代码:(游标已在全局变量中定义)
string c;
int d;
open mycursor;
do until kind=0
fetch mycursor into :c;
messagebox(c," ")
select gcon into :d
from sale
where gnum=:c;
update goods_2
set samount=samount+:d
where gnum=:c;
kind=kind - 1;
loop;
close mycursor;
delete from sale;
dw_1.retrieve()
希望能得到解答,不胜感激
祝大家新年快乐~