我的一个procedure a中,open一个cursor,然后我想把cursor的某一条记录传递给procedure bprocudure a
begin
 for iRec in cr_cursor loop
  b(iRec);
  ...
 end loop;
end;procedure b(c cursor)
begin
  id := c.id;
  name := c.name;
  ...
end;代码大体如上,不知道可不可行,其实可以直接传递cursor值得
b(iRec.id,iRec.name...)不过传递的参数可能随着应用改变而改变,不方便

解决方案 »

  1.   

    完全可以,REF CURSOR。
    http://blog.csdn.net/fw0124/article/details/6626370
      

  2.   


    这种例子见过,我这边用pl sql 开发,语法好像不太一样create package pkg_demo is
    begin
    Type R_Cursor is ref cursor;
    ...
    end;
    create package body pkg_demo  is
    procedure a is
     R_Cursor c_demon is
       select * from ...
    begin
      open c_demon 
    ..
    end;
    body 里面建立一个cursor的语法报错,这个语法是怎样的...