-- Model declare @ memberid int declare cstemp cursor
Select memberid from XXX open cstemp fetch next from cstemp into @ memberidwhile @ fetch_status = 0 begin
Xxx ......
Fetch next from cstemp into @ memberid
End close cstempdeallocate cstemp
-- Example: declare @ memberid int, @ betcoin money, @ awardcoin money, @ issystem bit -- winning Member, cast by member, number of currently rewarded golden beans declare cstemp cursor for select distinct memberid, betcoin, issystem from repository where wincoin = 0 and [email protected] And betnumber = @ result and (issystem = 0 or issystemgamegoldexchange = 1) Open cstemp fetch next from cstemp into @ memberid, @ betcoin, @ issystem while @ fetch_status = 0 -- if the cursor has a in
-- Processing statement .....
Set @ awardcoin = round (@ betcoin * @ PV, 0, 1)
Exec p_member_changegold_value 'game', @ awardcoin, @ memberid, 1
Fetch next from cstemp into @ memberid, @ betcoin, @ issystem -- jump to the next cursor end close cstemp -- close the cursor deallocate cstemp -- release the cursor