在pl\sql的命令窗口如何执行返回记录集的存储过程 存储过程如下procedure MENURIGHT(V_USERCODE VARCHAR2,P_CUR out U_CUR) IS

解决方案 »

  1.   

    declare
    v_cur U_CUR;
    v_user_code varchar2(300);
    begin
      v_user_code:='000';
      MENURIGHT(v_user_code,v_cur);
    end;
    /
      

  2.   

    sql>var x refcursor;
    sql>exec MENURIGHT('user_code', :x);
    sql>print :x;
      

  3.   

    pl\sql用dbms_output.put_line()吧.试试:借上面兄弟的代码
    declare 
    v_cur U_CUR; 
    v_user_code varchar2(300); 
    begin 
      v_user_code:='000'; 
      MENURIGHT(v_user_code,v_cur);
     for v in v_cur loop
        dbms_output.put_line(v.f1,v.f1....v.fn);
      end loop;
    end; 
    /
      

  4.   

    exec MENURIGHT(V_USERCODE ,P_CUR out U_CUR)