Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Interesting question: Result set break down by multiple pages on Web site.
Another way could be adding 'rownum' to the sql and putting it as a
subquery.
For eg. if the initial query was :
Select a, b from x;
Now the query becomes :
Select a, b
from (Select a, b, rownum as line# from x)
where line# between 50 and 100 ;
This gives us a range of records between the 50th and 100th row.
Steve Halko <steveh_at_redshift.com> wrote in article
<s78jqv1roj8148_at_corp.supernews.com>...
> The way we do it is to store the result set in a temporary table which
has
> an extra column to signify the line number. Then to actually display the
> result set, we query the temporary table WHERE line_number BETWEEN x AND
y.
> The user can then go to any page using Previous and Next buttons, or jump
to
> any page at random. The number of lines displayed on a page can be
adjusted
> by changing a PL/SQL variable - and this can be hard-wired in the code,
can
> be chosen by the user, or can be made dependent on the user's screen
> resolution.
>
> "Shaojie Hu" <maichen_at_rols.com> wrote in message
> news:85069d$kor$1_at_bob.news.rcn.net...
> > Hi, all:
> >
> > I am trying to figure it out how to break down Oracle results by pages
so
> > that I can
> > put results on many dynamic web pages. To be more acuate, I don't want
> > Oracle to
> > return all rows, but only rows in certain range one at a time. For
> example,
> > if a search
> > returns 1000 rows and 50 rows make a page, then I will have 20 web
pages.
> If
> > a user
> > click on page number 5, he will get rows between 201 and 250 and these
50
> > rows are
> > acutually fetched from database and the rest 950 rows are not fetched.
> >
> > Any ideas?
> >
> > Shu
> >
> >
>
>
>
Received on Sat Jan 08 2000 - 14:13:34 CST
![]() |
![]() |