Re: same reseult set with less column

From: <dt1649651_at_yahoo.com>
Date: Mon, 29 Sep 2008 07:20:06 -0700 (PDT)
Message-ID: <910957aa-0b61-4bd0-96d9-00bbaf5415af@k37g2000hsf.googlegroups.com>


On Sep 28, 9:46 pm, Ed Prochak <edproc..._at_gmail.com> wrote:

> Since you are using JAVA, why not open the cursor, fetch the N rows
> you need and close the cursor?
>
> No offense intended, DT, but I've never been a fan of ROWNUM. It leads
> to wrong thinking about database results. The row count treats results
> like records instead of rows. And funny how it always seems to be web
> apps that use this most often.
>
> Can you describe what constitutes the TOP N rows? What ordering do you
> use? Often if you can describe the rule you can code it into the
> query.

Ed, thanks for your advice. Because the data may contains hundreds of thousands of rows, it takes a lot of memory to read all of them. So I use "lazy read" to read only one page at a time and when users want to see a page that is not already in memory, then I will fetch that page only. So I use the top-N to read that page.

Here is what I use :
http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html

Thanks,
DT Received on Mon Sep 29 2008 - 09:20:06 CDT

Original text of this message