读书人

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

发布时间: 2012-01-22 22:38:43 作者: rapoo

请教这个游标出了什么问题
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。。。。。???

读书人网 >SQL Server

热点推荐