Re: sql question
Posted in 1995
On Oct 13, 12:56pm, John Prideaux wrote: > Subject: Re: sql question > onlinedbc@cix.compulink.co.uk ("Malcolm Weallans") wrote: > >An enhancement to the suggestion made would be to use a SCROLL cursor and > >then fetch absolute COUNT-50. Then you could fetch next the rest of the > >records > > > > [ much of previous discussion deleted ] > > I think that scroll cursors take a "snapshot" of the set of rows, so there > will be substantial overhead if you are selecting a large number of rows. > Other than that, it seems to be a very appropriate suggestion. > > John Prideaux > alastl@ix.netcom.com > >-- End of excerpt from John Prideaux It would be more accurate to say that they keep a snapshot of the rows that you have fetched. As you fetch each row it puts the data in a temporary table to allow for the fetch backwards and fetch absolute < current commands to ensure that it shows you what you saw the last time you fetched the row. But it doesn't fill the temptable until you fetch a row at which point it will read and fill rows from the start of the returned set, up to the row requested. Subsequent fetches read and fill the temp table from the current highest position in the return set, up to the row requested assuming this is higher in the set than the previous fetch. If not it retrieves the data from the temporary table which may no longer contain the same data as is in the database if you are not using repeatable read on the cursor. Cheers - Jim -- ----------------------------------------------------------------------------- Jim Gordon DHL Airways Inc. jgordon@us.dhl.com ----------------------------------------------------------------------------- My opinions are my own. They may vary with time but they remain mine!