Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> how to display partial results from a query (effectively)
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