aspose file tools
The moose likes Oracle/OAS and the fly likes can i display only first few records from oracle sql Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Reply Bookmark "can i display only first few records from oracle sql" Watch "can i display only first few records from oracle sql" New topic
Author

can i display only first few records from oracle sql

srinivas sv
Greenhorn

Joined: Oct 04, 2003
Posts: 13
helo to everyone on javaranch,
i am using oracle as a backend on j2ee, they r about 1000 records my sql query retreives. Since storing 1000 records at the server side will increase the burden on server i want to display only firt 50 and then next 50 upon the client request.
Is there any provision in oracle sql using which i can retrieve only first few records then next few records.
thanx in advance
Leslie Chaim
Ranch Hand

Joined: May 22, 2002
Posts: 336
Use ROWNUM for that..
select ...
from ...
where ...
and rownum < 50


Normal is in the eye of the beholder
srinivas sv
Greenhorn

Joined: Oct 04, 2003
Posts: 13
thanx for reply,
They r many columns which have to be retreived will the use of rownum will effect the performance.
yogesh sood
Ranch Hand

Joined: Aug 31, 2000
Posts: 108
Hi there,
I think there is no performance issue as rownum is generated for each record when you run SQL QUery therefore when 1000 records are returned from server then each one is given a unique id even though you do not use it only performance concern is that last Where clause which i dont think will take much of the query excecution time.
Any suggestions


If its green its biology if its stinkks its chemistry if it has numbers it is Maths and if it doesn't work its TECHNOLOGY
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i display only first few records from oracle sql
 
Similar Threads
how to display N number of records?
can i display only first few records from oracle sql
Optimising Pagination
Problem with resultset FetchSize() method
How to retrieve partial data in SQL Server ?