sql语法回顾:“fetch: 提取类型 last 不能与只进游标一起使用。”

sql语法回顾:“fetch: 提取类型 last 不能与只进游标一起使用。”

标签: sql
 分类:

 

[sql] view plain copy
 
 print?在CODE上查看代码片派生到我的代码片
  1. declare @qk char(4)  
  2. declare cqk   cursor  for  
  3. select qkb.qkh from qkb,tgb where (qkm = '计算机学报' and qkb.qkh = tgb.qkh and sgjg = '未通过')  
  4. open cqk  
  5. fetch last from  cqk into  @qk  
  6. update tgb set sgjg = '通过' where tgb.qkh = @qk  
  7. close cqk  
  8. deallocate cqk  


 

有段时间没用sql,语法就忘了,这个问题出现的原因很简单:

 

 
  1. declare cqk scroll cursor  for  
声明游标时记得加上scroll关键字才能使用fectch last;

posted on 2016-12-07 17:40  高达  阅读(1785)  评论(0)    收藏  举报

导航