Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Paging-Query based

 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I have decided to implement query based paging for my huge report which can return large resultsets and now I need help with implementation.

In Oracle I learned about ROWNUM keyword. And I read articles about using ORDER BY DESC..

have anyone implemented this in Oracle ? If so, can you help ?

Thanks,
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've used "select ... rownum() where rownum < nnn" in Oracle for this kind of thing. It's been years ... that's probably not exactly the right syntax. Today I had to learn "FETCH FIRST nnn ROWS ONLY" for DB2. ORDER BY might make the database engine fetch all rows and sort them before giving you the count you want so you may not save much.

Here are some notes from prior conversations about paging ...
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!