当前位置: 代码迷 >> Oracle开发 >> Oracle 分页的存储过程,该怎么解决
  详细解决方案

Oracle 分页的存储过程,该怎么解决

热度:65   发布时间:2016-04-24 07:29:05.0
Oracle 分页的存储过程
---currIndex当前页码 pageSize每页显示的记录数
create or replace procedure proc_PageSize(currIndex in number,pageSize in number)
is
begin
select *
  from (select t.*,row_number() over(order by lsh) rankid
from c1_menu t order by t.lsh) c1_menu
 where rankid > currIndex * pageSize
  and rankid <= (currIndex * pageSize) + pagesize;
 end;

exec procedure proc_PageSize 1,10

创建的时候报PLS-00428:在此select语句中缺少INTO子句,求oracle高手指点,因为从事NET开发Oracle用的很少,最近
一个项目用oracle,语法和sql还是有很大区别,求解决!


------解决方案--------------------
create or replace procedure proc_PageSize(currIndex in number,pageSize in number)
is
begin
select * 
from
(select *,row_number() rankid
from c1_menu t order by t.lsh) c1_menu
 where rankid > currIndex * pageSize
and rankid <= (currIndex * pageSize) + pagesize;
 end;


------解决方案--------------------
create or replace procedure proc_PageSize(currIndex in number,pageSize in number)
is
-----这里声明一个记录
begin
select * into ------这里写上记录名
from (select t.*,row_number() over(order by lsh) rankid
from c1_menu t order by t.lsh) c1_menu
 where rankid > currIndex * pageSize
and rankid <= (currIndex * pageSize) + pagesize;
 end;
 

------解决方案--------------------
探讨
引用:
SQL code

create or replace procedure proc_PageSize(currIndex in number,pageSize in number)
..

--页码和每页 显示的记录数。
/**
1.查处来的结果 应该 放入游标 作为 输出参数
2.查询 sql 给 游标 赋值
如下 :
**/
create or……

代码迷推荐解决方案:oracle存储过程,http://www.daimami.com/search?q=177537
  相关解决方案