--创建分页查询包create or replace package AutoPagenation IS-- 返回结果集的游标TYPE typeCousor IS REF CURSOR;-- 分页的存储过程procedure PageNation(tblName in varchar2, --查询的表名strFields in varchar2,--查询的字段strSortedField IN varchar2,--排序的字段sortType IN NUMBER,--排序的类型,1为DESC,默认为ASCpageSize IN NUMBER,--分页的容量,默认为20条/页pageIndex IN NUMBER,--要取的页码,默认为第1页strWhere IN varchar2,--查询条件,不要写WhererecordCount OUT VARCHAR2,--输出值,记录总数selRecords OUT typeCousor);end AutoPagenation;--实现分页查询包中声明的存储过程 create or replace package body AutoPagenation isPROCEDURE PageNation(tblName in varchar2, --查询的表名strFields in varchar2,--查询的字段strSortedField IN varchar2,--排序的字段sortType IN NUMBER,--排序的类型,1为DESC,默认为ASCpageSize IN NUMBER,--分页的容量,默认为20条/页pageIndex IN NUMBER,--要取的页码,默认为第1页strWhere IN VARCHAR2,--查询条件,不要写WhererecordCount OUT VARCHAR2,--输出值,记录总数selRecords OUT typeCousor --输出的结果集) IStmpSortType VARCHAR2(10);tmpPageSize NUMBER;tmpPageIndex NUMBER;tmpStrSqlCount VARCHAR2(500);tmpStrSql VARCHAR2(500);tmpStrRecodSql varchar2(500);startPageDataIndex NUMBER;endPageDataIndex NUMBER;BEGIN--排序的类型IF sortType = 1 THENtmpSortType := ' DESC';ELSEtmpSortType := ' ASC';END IF;--分页容量IF pageSize IS NULL OR pageSize = 0 THENtmpPageSize := 20;ELSEtmpPageSize := pageSize;END IF;--要取的页码IF pageIndex IS NULL OR pageIndex = 0 THENtmpPageIndex := 1;ELSEtmpPageIndex := pageIndex;END IF;--查询记录IF strWhere IS NULL OR strWhere = ' ' THENBEGINtmpStrSqlCount := 'SELECT COUNT(*) FROM '||tblName;IF strFields = '*' THENtmpStrSql := 'SELECT t.* from '||tblName||' t order by '||strSortedField||tmpSortType;ELSEtmpStrSql := 'SELECT '||strFields||' from '||tblName||' order by '||strSortedField||tmpSortType;END IF;END;ELSEBEGINtmpStrSqlCount := 'SELECT COUNT(*) FROM '||tblName||' where '||strWhere;IF strFields = '*' THENtmpStrSql := 'SELECT t.* from '||tblName||' t where '||strWhere||' order by '||strSortedField||tmpSortType;ELSEtmpStrSql := 'SELECT '||strFields||' from '||tblName||' where '||strWhere||' order by '||strSortedField||tmpSortType;END IF;END;END IF;--EXECUTE IMMEDIATE tmpStrSqlCount INTO recordCount;--- 定义始终页码的数据位置startPageDataIndex := tmpPageSize* ( tmpPageIndex -1)+1;endPageDataIndex := tmpPageIndex * tmpPageSize;--取出页码定义的结果集tmpStrRecodSql := 'WITH tmptable AS (SELECT ROWNUM rowno,tmp.* FROM ('||tmpStrSql||') tmp) select * from tmptable where rowno between '||startPageDataIndex||' and '||endPageDataIndex;OPEN selRecords FOR tmpStrRecodSql;end PageNation;end AutoPagenation;哪位高手有简单点的分页存储过程, 介绍下啊.  谢谢