关于oracle游标的一个问题,比如有如下一个游标,如何获取到它每次读出来的数据?比如用个变量去接受?
DECLARERoyCURSORFORSELECTTOP3*FROMsysobjectsOPENRoyFETCHNEXTFROMRoyWHILE@@FETCH_STATU...
DECLARE Roy CURSOR FOR
SELECT TOP 3 * FROM sysobjects
OPEN Roy
FETCH NEXT FROM Roy
WHILE @@FETCH_STATUS=0
BEGIN
FETCH NEXT FROM Roy
END
CLOSE Roy
DEALLOCATE Roy 展开
SELECT TOP 3 * FROM sysobjects
OPEN Roy
FETCH NEXT FROM Roy
WHILE @@FETCH_STATUS=0
BEGIN
FETCH NEXT FROM Roy
END
CLOSE Roy
DEALLOCATE Roy 展开
2个回答
展开全部
FETCH NEXT FROM Roy into @variable1,@variable2 按照select字段顺序写。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询