Our data is constantly changing so caching really wasn't an option and we
saw no need to retrieve 10k records from the db but only show the user 25 or
50 or 100 of them at a time. So in Oracle you can set a start/limit in the
query like so:  (Might be a syntax error in there as I haven't had any
coffee yet :-) )

Select * From
    (
      Select rownum rnum, p.* From
        (
          SELECT count(1) Over() totalCount, a.columns, b.columns  FROM
table a, table b WHERE a.id = b.id ORDER BY a.name
         ) p
    Where rownum <= #Abs((start + Limit) - 1)#
    )
Where rnum >= #start#


The paging is simple enough to implement and even easier using EXT.
Obviously if you're not using Oracle this won't work but  I'm sure the other
db's have a similar way to accomplish this.


Nick



On Thu, Feb 19, 2009 at 12:34 AM, Mike Soultanian <[email protected]>wrote:

>
> Nathan Strutz wrote:
> > 1) cache it in ColdFusion - just use the cachedWithin attribute of
> cfquery,
> > it's easy, it works great. Set it to a day or 5 minutes or 1 minute or
> even
> > 10 seconds if you're concerned about the data being out of date. This is
>
> Hey Nathan,
> The only think that I'm confused about is that if I'm using the caching,
> does it makes sense to retrieve all of the records?  What if the user
> decides to jump to the end of the list... that would mean that I have to
> have the entire recordset cached, right?
>
>
> > And remember, for server-side paging (next/prev buttons, etc), you should
> > use my CFC - http://paginationcfc.riaforge.org/
>
> Yeah, I've downloaded it, just haven't had a chance to play with it yet.
>
> Thanks!
> Mike
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319527
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to