写一个过程实现吧:
create package test_age
as
type mycursor is ref cursor;
end;
/
create procedure pro(p_page in number,p_rc out test_age.mycursor)
as
str varchar2(100);
begin
str:='select * from table_name where rownum<='||p_page;
open p_rc for str;
end;
/

解决方案 »

  1.   

    不是用sql写的吧!用前台写更好。用sql不好写。
      

  2.   

    beckhambobo(beckham)
    你的能行吗? 好像只能返回前p_page条吧!!!!!!!
    你的 procedure 如何调用才能返回next 50条记录??????
    请高手回音!!!!!!!!!!
      

  3.   

    create procedure pro(p_page in number,p_rc out test_age.mycursor)
    as
    str varchar2(100);
    begin
    str:='select * from table_name where rownum<='||p_page
          ||'minus'
          ||'select * from table_name where rownum<='||p_page-50;
    open p_rc for str;
    end;
    /