通用ORACLE 分页查询语句,存储过程实现
来源:互联网 发布:php获取cookie 编辑:程序博客网 时间:2024/05/24 15:42
PROCEDURE RECORDS_LIST
(
sqlrecords in varchar2,
sqlrecordscount in varchar2,
cur_result_out out serarch_result,
totalcount out int,
curpage in int,
perpage in int,
icurpage out int,
totalpage out int
)
IS
startno int;
endno int;
tempno float;
BEGIN
execute immediate sqlrecordscount into totalcount;
--tempno := (totalcount+perpage-1)*1.00/perpage*1.00;
--tempno := mod(totalcount,perpage);
totalpage := ceil(totalcount/perpage);
icurpage := curpage;
if curpage > totalpage then
icurpage := totalpage;
elsif curpage < 1 then
icurpage := 1;
end if;
startno := (icurpage-1)*perpage+1;
endno := icurpage*perpage;
dbms_output.put_line('select * from (select rownum row_num,a.* from (');
dbms_output.put_line(') a ) where row_num between ');
dbms_output.put_line(startno);
dbms_output.put_line(' and ');
dbms_output.put_line(endno);
open cur_result_out for 'select * from (select rownum row_num,a.* from ('||sqlrecords||') a ) where row_num between '||startno||' and '||endno;
--open cur_result_out for sqlpersons;
EXCEPTION
WHEN others THEN
raise;
END RECORDS_LIST;
- 通用ORACLE 分页查询语句,存储过程实现
- 通用分页查询存储过程
- 分页查询存储过程[通用]
- 通用分页查询存储过程
- 通用分页查询存储过程
- Oracle分页通用存储过程
- Oracle 分页语句,存储过程
- SQLServer分页查询通用存储过程
- Mysql分页查询通用存储过程
- 通用分页显示查询存储过程
- Mysql分页查询通用存储过程
- SQLServer分页查询通用存储过程
- mysql分页查询通用存储过程
- SQLServer分页查询通用存储过程
- SQL之通用查询分页存储过程
- Mysql分页查询通用存储过程
- Mysql分页查询通用存储过程
- SQL之通用查询分页存储过程
- HTTP 错误 403.9 - 禁止访问:连接的用户过多 XP IIS服务器连接数的修改
- jQuery插件JQuery Pager分页器实现javascript分页功能
- DLL远程注入实例
- 使用 vps主机 必须要做的六件事 10互联提醒您
- 7-9札记
- 通用ORACLE 分页查询语句,存储过程实现
- iPHone 中用 NSURLRequest 模拟 POST 和GET 请求
- 项目经理处理和产品经理的关系
- IE下通过javascript如何获取本地网卡IP,MAC地址,计算机名
- 永久免费的备忘提醒、人脉客户管理软件
- Eclipse中java通过JDBC连接Sql Server 2005
- 使用FormView控件对数据分页
- Codetimer 学习...
- Mixed-Mode Library Assembly Bug and Managed C++