http://expert.csdn.net/Expert/TopicView1.asp?id=2870639

解决方案 »

  1.   

    我想知道的是,如下:
     (
     p_用户名 in 用户信息.用户名%TYPE,
     pcs out cursor
    )
    as
    begin
     open pcs for
     select rownum,用户名,密码 from 用户信息 where 用户名=p_用户名 and 密码=p_密码;
    end;在这应该要写一个共用的游标pcs,请问应该如何写呢?
      

  2.   

    create package test_age
    as
    begin
    type mycursor is ref curosr;
    end;
    /
    create or replace procedure test_aaa(p_rc out test_age.mycursor)
    as
    begin
    open p_rc for select * from scott.emp where sal >800;
    end;将游标定义到包中
      

  3.   

    create package test_age
    as
    type m_rc is ref cursor;
    end;
    /
    create procedure pro(p_用户名 in varchar2,p_rc out test_age.m_rc) 
    as 
    begin 
    open p_rc for 'select * from 用户信息 where 用户名='||P_用户名; 
    end; 
    /
      

  4.   

    create package test_age
    as
    begin
    type mycursor is ref curosr;
    end;
    楼上的不行呀!出错!程序包出错!麻烦你检查一下!