Subject Re: [firebird-support] Digest Number 2473
Author Myles Wakeham
> On 21-Jul-2004 07:45:23, Stan wrote:
> In the IBObjects group (I am posting in this group rather than IBObjects
> because my question is "wider" than just IBO issues) Helen recently wrote:
> "Always use a parameterised WHERE clause to limit the output to 200 rows
> less."
> This, of course, is good advice. I would like to know how to implement
> limitation when the result set is controlled by the user. I'm thinking of
> the (common, I suppose) case where the user types a few characters (of,
> a product or a last name) and clicks a Search button, the intention being
> provide the user with a list they can scroll through to select their
> item or person. Even if the software requires the typing of more than
> one or two letters before searching, it can still be the case that the
> resulting search will contain more than 200 items. What techniques or
> components might be suggested to limit the response set to 200 items while
> still allowing the user to seamlessly scroll through their intended result
> set?

I can't talk directly to the IBO style of doing this, but outside of Delphi
a technique we have adopted is to add the premise of 'Pages' to the Grid
outputs. Therefore if a user wants to retrieve, say, 10,000 rows and show
them on a grid interface, you do the query (we do this through a stored
procedure on the server so that we can control the query, start row #, end
row #, etc.) and return back a 'page' of data. We have it so that the page
size is controlled by user preference, but it works much in the same way as
a web interface.

The user can do a next/previous page, first page, last page, etc. but each
page may contain say 200 rows. This way they can walk through data, without
it requiring a huge amount of network traffic to move 10,000 rows of data
from the database to the client application.

Hope this helps.


Myles Wakeham
Director of Engineering
Tech Solutions US, Inc.
(480) 451-7440