Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: getting X rows at a time via JDBC (i.e. no cursors)
> > 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
![]() |
![]() |