taitoushan
2010-01-19 09:25
浏览 288
已采纳

关于ORACLE里的游标处理问题

DB2数据库的存储过程里有这样一句:
[code="java"]begin

declare sel_cur cursor with return to caller for select * from tmp_zzybtz_day_lsb order by day,daymc ;
open sel_cur;
end; [/code]

我转换为ORACLE的存储过程写成这样:
[code="java"]begin

cursor sel_cur is select * from tmp_zzybtz_day_lsb order by day,daymc ;
open sel_cur;
end; [/code]

可是运行还是报错:
Compilation errors for PROCEDURE JCFX.P_ZZYBTZ_DAY

Error: PLS-00103: Encountered the symbol "SEL_CUR" when expecting one of the following:

      := . ( @ % ;

Line: 144
Text: cursor sel_cur is select * from tmp_zzybtz_day_lsb order by day,daymc ;

Error: PLS-00103: Encountered the symbol "END" when expecting one of the following:

      begin function package pragma procedure subtype type use
      <an identifier> <a double-quoted delimited-identifier> form
      current cursor

Line: 146
Text: end;

[color=red]DB2的语法怎么转换成ORACLE里的呢,我对游标不是很熟悉[/color]

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • 关键词㏄ 2010-01-21 17:38
    已采纳

    oracle的游标是在声明区域定义的,在主体中打开。

    已采纳该答案
    打赏 评论
  • xxxxxxxxxxxxxxxxx 2010-01-19 11:55
    打赏 评论

相关推荐 更多相似问题