Mark Horrocks wrote:
> I am currently converting a large Delphi webbroker application to RoR.
> The Delphi application makes extensive use of client datasets and
> setrange which can limit the range of records returned to a client
> dataset in an SQL call without the overhead of making another SQL call.
> The setrange call can be issued in a loop to repeatedly change the range
> of records viewable in the dataset

This is probably not a great way of doing things.  If you have 1000 
records that you're paging through 10 at a time, there is no reason to 
fetch all 1000 if you only want to read 10.  Certainly you should avoid 
extra queries, but you should also avoid unnecessarily large results. 
In the example I gave, I think separate queries would be the better 
solution.  If you can describe your use case in more detail, it might 
help.
> 
> My app frequently issues the setrange command to a dataset in a loop in
> order to test for previous game time bookings in a sports application.
> Is there any way I can do this in Rails or do I need to repeatedly make
> SQL queries to return the data subset?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to