Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: getting X rows at a time via JDBC (i.e. no cursors)

Re: getting X rows at a time via JDBC (i.e. no cursors)

From: Mat Kelcey <matthew.kelcey_at_SPAMMENOT.nokia.com>
Date: 2000/06/01
Message-ID: <3935F056.6E635302@SPAMMENOT.nokia.com>#1/1

> > For your problem the solution will be (as I understand your problem):
> >
> > select sub.*
> > from
> > (
> > select rownum num , tab.*
> > from nm_user_info tab
> > where tab.user = 'joe'
> > ) sub
> > where sub.num between X and X+10;
> >
> > where X is the start-rownum
>
> Except that this won't work, because ROWNUM is assigned based on records
> which meet the where clause -- since ROWNUM = 1 does not meet the
> where clause, no record will actually be returned.
>
> I suggest you go back to Plan A: grabbing X records from a ResultSet,
> then waiting for the request for more records and grabbing X more
> records. Storing a ResultSet should not consume vast amounts of
> memory. (I'm sure you can perform a test to determine whether or not
> it actually does ...)
>
> Best,
>
> Brett Neumeier
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

(sorry to interrupt but i missed the details of plan A)

if you grab the first X records how do you then get the next X records without getting the first X records again?

if you have to get records 1 to nX for each 'n' this will start to slow down, especially if there are 1,000,000+ rows...

mat Received on Thu Jun 01 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US