Subject | Re: A virtual scolling list using Firebird |
---|---|
Author | joeyekstrom |
Post date | 2004-12-08T18:50:11Z |
Thanks. I have one more question:
Is there a way to number the results of a SELECT, so that I could do
something like this:
SELECT FIRST 1 index FROM (
SELECT index FROM (
SELECT index FROM foo WHERE foo.field='400'
)
) ;
Or some way so that I could do a search for a specific value, and skip
until I got to the first one of that value?
-Joey
--- In firebird-support@yahoogroups.com, "mk_delphi" <mk_delphi@y...>
wrote:
Is there a way to number the results of a SELECT, so that I could do
something like this:
SELECT FIRST 1 index FROM (
SELECT index FROM (
SELECT index FROM foo WHERE foo.field='400'
)
) ;
Or some way so that I could do a search for a specific value, and skip
until I got to the first one of that value?
-Joey
--- In firebird-support@yahoogroups.com, "mk_delphi" <mk_delphi@y...>
wrote:
>
> SELECT FIRST x [SKIP y] [rest of query]
>
> It will then return x rows of result from the query, and optionally
> skip first y rows. For example, returning row 21-30 from a query
> would be something like this in Firebird:
>
> SELECT FIRST 10 SKIP 20 column1, column2, column3 FROM foo
>
> Ciao
> Marco
>
>
> --- In firebird-support@yahoogroups.com, "joeyekstrom"
> <joeyekstrom@y...> wrote:
> >
> >
> > We are creating a virtual scolling list that will contain 100,000+
> > entries, however only 20-100 entries will be displayed at any given
> > time to the user. Each entry corresponds to a row in the database,
> > and has multiple fields, which the user can sort the entries on.
> > Because there are multiple users, the table will have millions of
> > rows. There will be multiple users running on the same machine
> > concurrently, so I would like to avoid loading all the entries in
> the
> > list into memory.
> >
> > In order to support basic scrollbar functionality, I need to be able
> > to grab windowed chunks of 20-100 out of sorted list. On SQL
> Server,
> > they have bi-directional cursors where I can randomly access the
> data.
> > I haven't been able to find anything like this on Firebird. Any
> > ideas as to how I would do this using Firebird?
> > Virtual scrolling requirements:
> >
> > 1. return the total number of records(rows) in a query result set.
> > 2. Be able to efficiently return a window of result set rows based
> on
> > a offset into the result set and a count of records.
> > 3. Be able to sub query the result set mentioned above to retrieve
> the
> > index of a particular row.
> >
> > As far as I understand Firebird doesn't have bi-directional cursors.
> > I understand that firebird may not have the exact functionality I
> > described above.
> >
> > I was wondering if there was another way to get that functionality
> or
> > work around missing features in firebird?
> >
> > Thanks
> >
> > -Joey