如何看游标里有什么记录
--声明游标变量
DECLARE
@priority int,
@vendor_id varchar(10)
DECLARE vendor_cursor CURSOR FOR
SELECT vendor_id,priority FROM wh_vendor_pay_info WHERE trans=1 AND priority=0
OPEN vendor_cursor
FETCH FROM vendor_cursor
INTO @vendor_id,@priority
WHILE @@FETCH_STATUS=0
BEGIN
UPDATE wh_vendor_pay_info SET priority=0 WHERE (trans=0) AND (vendor_id<>@vendor_id)
FETCH vendor_cursor
INTO @vendor_id,@priority
END
--关闭游标
CLOSE vendor_cursor
--释放游标
DEALLOCATE vendor_cursor
----------------
SELECT vendor_id,priority FROM wh_vendor_pay_info WHERE trans=1 AND priority=0
OPEN vendor_cursor
FETCH FROM vendor_cursor
INTO @vendor_id,@priority
如何看看此时游标中@vendor_id,@priority是什么值?
FETCH vendor_cursor
INTO @vendor_id,@priority
END
--关闭游标
CLOSE vendor_cursor
--释放游标
DEALLOCATE vendor_cursor