声明游标默认为read only.把它改成
declare p cursor for select * from table1 order by riqi
for update [of 列名1(如hhh),列名2.....]

解决方案 »

  1.   

    declare p cursor for select * from table1 order by riqi 
     FOR UPDATE hhh;
    open p;
    fetch p;
    update table1 set hhh="*" where current of p;
      

  2.   

    READ ONLYPrevents updates made through this cursor.在 UPDATE 或 DELETE 语句的 WHERE CURRENT OF 子句中不能引用游标。该选项替代要更新的游标的默认功能。UPDATE [OF column_name [,...n]]定义游标内可更新的列。如果指定 OF column_name [,...n] 参数,则只允许修改所列出的列。如果在 UPDATE 中未指定列的列表,则可以更新所有列。
      

  3.   

    加上:
    FOR UPDATE hhh