Re: fetching rows from a certain point after closing cursor

From: Ashley Coutinho <ashley_at_ibmail.smst290.att.com>
Date: 1996/09/10
Message-ID: <3235B1CF.1C71_at_ibmail.smst290.att.com>#1/1


John Verhoeven wrote:
>
> In article dated Sat, 07 Sep 1996 14:56:52 -0400, Ashley Coutinho (ashley_at_ibmail.smst290.att.com) wrote:
> > I developing an interface to our database over the WWW.
> >
> > Problem:
> > User conducts a query.
> > Declare cursor
> > Query matches 100 records but I fetch 20 only.
> > Close cursor
> > Program exits
> >
> > User asks for the next 20.
> > ?????? How do I start from the previous point
> > without querying the old 20 records ????????
>
> I assume each row has a unique key.
> * Return the rows in order of the unique key.
> * Remember the key of the last row returned
> * When user wants next 20 rows
> - select .... where key > last_key_value
>

  Thanks to all for the suggestions.

  I think that the above approach as suggested by John is the one I was going
  to use. Yes, each row should have a unique key. Also, it depends on the 'order by'
  criteria used for the 'select', i.e. the where clause depends on the order by
  criteria.

  As for implementing this over a web interface. Here's an approach...

  Have a daemon process ( or a server process ) which maintains a connection to
  the database. The cgi program then communicates with the daemon to carry out
  the user's request.

  Please let me know if you have other approaches or suggestions.

-- 
Email: ashley_at_ibmail.smst290.att.com
Received on Tue Sep 10 1996 - 00:00:00 CEST

Original text of this message