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

Home -> Community -> Usenet -> c.d.o.server -> how to display partial results from a query (effectively)

how to display partial results from a query (effectively)

From: Sharkie <sharkdba_at_yahoo.com>
Date: 28 Oct 2002 14:27:19 -0800
Message-ID: <423b5ab1.0210281427.5e89b604@posting.google.com>


Oracle 8.1.7 / Sun Solaris

I have a query against a users table which usually returns several hundreds records. These records are displayed on a web page 10 at a time, with a next/previous buttons. The problem is, the query is always executed "in full" so to speak. There is a CGI counter, and if the rowcount matches current page, it is displayed, otherwise not.

some pseudocode for page 2:

count=0;
<loop through this query:

select blahblah from users where blahblah order by blahbhal> count++;
//this is page 2, so display only results 11 through 20 if (count between 11 and 20)
  <td>display row here</td>
else null; //this is the problem, this runs for a long time
</loop through this query>

Since the query has to finish, it will sometimes take a long time to display the 10 results. There has to be a better way of doing this. Isn't there a way in oracle to quickly only return rows between certain rowcounts? Received on Mon Oct 28 2002 - 16:27:19 CST

Original text of this message

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