dbTalk Databases Forums  

same reseult set with less column

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss same reseult set with less column in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #51  
Old   
Ed Prochak
 
Posts: n/a

Default Re: same reseult set with less column - 09-29-2008 , 03:36 PM






On Sep 29, 9:20*am, "dt1649... (AT) yahoo (DOT) com" <dt1649... (AT) yahoo (DOT) com> wrote:
Quote:
On Sep 28, 9:46*pm, Ed Prochak <edproc... (AT) gmail (DOT) 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/ora...o17asktom.html

Thanks,
DT
Tom's article mentions three ways to do get top-N rows. So which do
you use?

Are you sure you are not missing any?
Ed.


Reply With Quote
  #52  
Old   
Ed Prochak
 
Posts: n/a

Default Re: same reseult set with less column - 09-29-2008 , 03:36 PM






On Sep 29, 9:20*am, "dt1649... (AT) yahoo (DOT) com" <dt1649... (AT) yahoo (DOT) com> wrote:
Quote:
On Sep 28, 9:46*pm, Ed Prochak <edproc... (AT) gmail (DOT) 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/ora...o17asktom.html

Thanks,
DT
Tom's article mentions three ways to do get top-N rows. So which do
you use?

Are you sure you are not missing any?
Ed.


Reply With Quote
  #53  
Old   
Ed Prochak
 
Posts: n/a

Default Re: same reseult set with less column - 09-29-2008 , 03:36 PM



On Sep 29, 9:20*am, "dt1649... (AT) yahoo (DOT) com" <dt1649... (AT) yahoo (DOT) com> wrote:
Quote:
On Sep 28, 9:46*pm, Ed Prochak <edproc... (AT) gmail (DOT) 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/ora...o17asktom.html

Thanks,
DT
Tom's article mentions three ways to do get top-N rows. So which do
you use?

Are you sure you are not missing any?
Ed.


Reply With Quote
  #54  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: same reseult set with less column - 09-29-2008 , 09:09 PM



Ed Prochak (edprochak (AT) gmail (DOT) com) wrote:

: 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.

Yes, because virtually every single web app in the world has to solve the
identical problem - how to display a set of rows one page at a time so
that the browser and user both receive a sensible amount of data, and
often how to do this in a stateless manner.




Reply With Quote
  #55  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: same reseult set with less column - 09-29-2008 , 09:09 PM



Ed Prochak (edprochak (AT) gmail (DOT) com) wrote:

: 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.

Yes, because virtually every single web app in the world has to solve the
identical problem - how to display a set of rows one page at a time so
that the browser and user both receive a sensible amount of data, and
often how to do this in a stateless manner.




Reply With Quote
  #56  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: same reseult set with less column - 09-29-2008 , 09:09 PM



Ed Prochak (edprochak (AT) gmail (DOT) com) wrote:

: 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.

Yes, because virtually every single web app in the world has to solve the
identical problem - how to display a set of rows one page at a time so
that the browser and user both receive a sensible amount of data, and
often how to do this in a stateless manner.




Reply With Quote
  #57  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: same reseult set with less column - 09-29-2008 , 09:09 PM



Ed Prochak (edprochak (AT) gmail (DOT) com) wrote:

: 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.

Yes, because virtually every single web app in the world has to solve the
identical problem - how to display a set of rows one page at a time so
that the browser and user both receive a sensible amount of data, and
often how to do this in a stateless manner.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.