在游标后用for update nowait 锁表,但提示错误。
CURSOR Csr01 IS
   select sum(num1)
     from  aaa
 where b='1'
   group  by
               a
for update nowait;
去掉sum就好用了,但我还想保留sum,该如何解决?还请赐教。

解决方案 »

  1.   

    楼主可以看一下num1字段的类型,感觉语句应该没有问题!
      

  2.   

    是数值型的,提示for update 不可使用,我把group by  和 sum去了就好用了
      

  3.   

    for update nowait;
    用在这里应该没有意义,舍去就应该可以了!
      

  4.   

    提示for update 不可使用,我把group by  和 sum去了就好用了========>for update 和 group by 不能混合使用
      

  5.   

    你既然已经用了group by ,那锁表有什么意义么?