我用的是PL/SQL Developer开发运行的
存储过程:
create or replace procedure testForCursor(cur out sys_refcursor) is
begin 
  open cur for
    select * from dual;
end;
调用:
declare
  cursor cur1 return dual%rowtype;
begin
  -- Call the procedure
  testforcursor(cur => :cur1);
end;
结果:
 /
declare
cursor cur1 return dual%rowtype;
begin
  -- Call the procedure
  testforcursor(cur => :cur1);
end;
ORA-01008: 并非所有变量都已关联
问题:为什么?

解决方案 »

  1.   

    out 是输出类型,并不是传入的参数
      

  2.   

    我问过的问题:
    http://community.csdn.net/Expert/topic/5301/5301481.xml?temp=.5152704
      

  3.   

    create or replace procedure testForCursor(cur out sys_refcursor) is
    begin 
      open cur for
        select * from dual;
    end;
    调用:
    declare
      cursor cur1 return dual%rowtype;
    begin
      -- Call the procedure
      testforcursor(cur => :cur1);
    end;
    结果:
     /
    declare
    cursor cur1 return dual%rowtype;
    begin
      -- Call the procedure
      testforcursor(cur => :cur1);
    end;
    ORA-01008: 并非所有变量都已关联
    问题:为什么?