beijingpz 2009-01-15 18:38
浏览 203
已采纳

关于oracle存储过程游标循环的问题

create or replace procedure pro_loop(userid in varchar2)
is

departid number(4);

begin

   begin

    declare
       cursor list is select departid from departmment ;

       rs list%rowtype;

       begin
         for rs in list loop

         dbms_output.put_line(rs.departid);

         end loop;
       end;

end;

/************************************************以上是存储过程******************************************/

PROCEDURE COMPANY.PRO_LOOP编译错误

错误:PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

      begin case declare end exception exit for goto if loop mod
      null pragma raise return select update while with
      <an identifier> <a double-quoted delimited-identifier>
      <a bind variable> << close current delete fetch lock insert
      open rollback savepoint set sql execute commit forall merge
      pipe

/*********************************************************************************************************/

烦请各位高手指正一二

  • 写回答

1条回答 默认 最新

  • etank2011 2009-01-17 00:56
    关注

    额。。。是不是应该在end结束后另起一行输入一个
    [code="java"]
    /
    [/code]表示结束
    看error的描述是到文件结尾了,而存储过程还没有结束

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?