首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

请问这个游标出了什么有关问题

2012-01-22 
请教这个游标出了什么问题declares_sc_cscrollcursorforselects.sno,s.sname,sc.cno,c.cname,sc.creditfro

请教这个游标出了什么问题
declare   s_sc_c   scroll   cursor
    for   select   s.sno,s.sname,sc.cno,c.cname,sc.credit
            from   student_infos   s,select_course   sc,course_infos   c
            where   s.sno=sc.sno   and   sc.cno=c.cno   and   sc.cno= '00002 '
    for   update   of   sc.credit

结果:
服务器:   消息   16957,级别   16,状态   4,行   2
在   READ   ONLY   游标上不能指定   FOR   UPDATE。

谢谢帮我捉虫。


[解决办法]
declare s_sc_c scroll cursor dynamic
for select s.sno,s.sname,sc.cno,c.cname,sc.credit
from student_infos s,select_course sc,course_infos c
where s.sno=sc.sno and sc.cno=c.cno and sc.cno= '00002 '
for update of sc.credit
[解决办法]
提示的因该是不能用 update 吧,
不知道LZ的 for update of sc.credit有什么用
[解决办法]
for update of sc.credit。。。。。???

热点排行