Re: paging

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: jorge (jor70_at_mail.com)
Date: 08/23/04


Date: 23 Aug 2004 16:57:15 -0700


> > select generateKey() as NewKey, * from table
> > where cCondition
> > order by cOrder
> > group by cGroup
> > having between ( NewKey, FirstRecordOfPage,
> > FirstRecordofPage+ItemsPerPage )
 
> But my test shows: Order By is done late,
> after generateKey() has already generated
> the same Recno() already gave us...

> web applications are another thing: There
> it would be okay to first select all and then
> create a html page with a certain
> "data page"...

Yeap
what I currently do in my script is
select 0 as NewKey, field1, field2, field3, field4, field5, field6 from table
                 where cCondition
                order by cOrder
replace all newkey with recno()
delete all for ! between ( NewKey, FirstRecordOfPage,
                     FirstRecordofPage+ItemsPerPage )

When there is no cCondition this brings all the table but
as this particular table it suppose to not be larger
 than 200k records I hope to be fine

Jorge