日期:2014-05-16 浏览次数:20566 次
create or replace procedure lpmtest10( tablename in varchar2, pagenow in number, pagesize in number, totalrecord out number, totalpage out number, lpmrecordset out sys_refcursor --游标类型 )is lpm_sql varchar2(200); v_begin number:=(pagenow-1)*pagesize+1; v_end number:=pagenow*pagesize; begin lpm_sql:='select * from (select e.*,rownum rn from (select * from '||tablename||')e where rownum<='||v_end||') where rn>='||v_begin; open lpmrecordset for lpm_sql; lpm_sql:='select count(*) from '||tablename; execute immediate lpm_sql into totalrecord; if(mod(totalrecord,pagesize)=0) then totalpage:=totalrecord/pagesize; else totalpage:=totalrecord/pagesize+1; end if; end;
?