首先获取数据总数:
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;
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;
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}