while(@@fetch_status=0)
begin
-- 语句1
select @OT=OperType,@TF=FundLots,@TFV=TFundVal,@TD=TDevotionMoney,@TT=TTakeMoney,@TB=TBonus
from BM_FCombOpertTbl where current of my_cursor
--语句2
update BM_FCombOpertTbl set TFundLots=@TFundLots,TFundVal=@TFundVal,TDevotionMoney=@TDevotionMoney,
TTakeMoney=@TTakeMoney,TBonus=@TBonus where current of my_cursor
end-----------------
语句1错误,语句2正确,因为current of 只能用在update语句,那么select语句用什么才能获取当前游标所在的行的数据呢?
begin
-- 语句1
select @OT=OperType,@TF=FundLots,@TFV=TFundVal,@TD=TDevotionMoney,@TT=TTakeMoney,@TB=TBonus
from BM_FCombOpertTbl where current of my_cursor
--语句2
update BM_FCombOpertTbl set TFundLots=@TFundLots,TFundVal=@TFundVal,TDevotionMoney=@TDevotionMoney,
TTakeMoney=@TTakeMoney,TBonus=@TBonus where current of my_cursor
end-----------------
语句1错误,语句2正确,因为current of 只能用在update语句,那么select语句用什么才能获取当前游标所在的行的数据呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货