Subject Re: [firebird-support] How to implement "fetch data on demand" at SQL level
Author Wei Yu
Hi, Helen

> If you are asking whether there is some SQL language
> element to limit the
> number of rows in the entire output set, then the
> answer is Yes. Use the
> SELECT FIRST m SKIP n syntax with an ordered set to
> return m rows starting
> at the nth row in the set. All of the rows
following > the (m + n)th row
> will be discarded, i.e. they will be eliminated from
> the set that the
> application can fetch from. Both the [FIRST n] and
> the [SKIP n] clauselets
> are optional.

This is what I want, but can I use the parameters to
pass the m and n value to SELECT statement, like:

Select first :m skip :n .....

Thanks

William

--- Helen Borrie <helebor@...> wrote:

> At 10:13 PM 19/12/2004 +0000, you wrote:
>
>
> >Hi, All
> >
> > I have a 20 rows grid that I just want to
> implement "fetch data on
> >demand" for it, that is I only want to fetch 20
> rows data from server
> >until the grid is scrolled, then fetch another 20
> rows, so what should
> >I do implement this purpose at SQL level (back
> end)?
>
> If you are asking whether there is some SQL language
> element to set the
> size of the buffer on the client side then the
> answer is No. Rows are
> returned one by one from a one-way cursor, in
> response to a call to
> isc_dsql_fetch. The client code is responsible for
> deciding how many rows
> to return, by putting the call inside a loop. Many
> data access interfaces
> encapsulate the required behaviour in their data
> access and data-aware
> controls. IB Objects, for example, uses a very
> sophisticated system with
> multiple cursors to make a scrollable dataset
> available to the application.
>
> If you are asking whether there is some SQL language
> element to limit the
> number of rows in the entire output set, then the
> answer is Yes. Use the
> SELECT FIRST m SKIP n syntax with an ordered set to
> return m rows starting
> at the nth row in the set. All of the rows
> following the (m + n)th row
> will be discarded, i.e. they will be eliminated from
> the set that the
> application can fetch from. Both the [FIRST n] and
> the [SKIP n] clauselets
> are optional.
>
> ./hb
>
>
>


=====
William, Yu


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com