Oracle实现分页数据

      DataBase 2005-10-8 9:27
首先获取数据总数:
execute immediate 'Select Count(*) from (Select [id] From [table] where [Condition])' into [iNum];

计算分页数据上下限:
[iLow] := [iPage] * [iPageSize];
[iHigh] := [ilow] + [iPageSize];

获取分页数据,游标返回:
sSql := 'Select * From [table] where id between [ilow] and [ihigh]';
open cur for sSql;

其中游标定义(在package中):
TYPE type_cur IS REF CURSOR;
函数中参数说明:out cur type_cur;
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}