Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Row count in oracle..?

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends

Is is possible to get the number of rows from oracle table with out using ResultSet rst .next() method .
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. But that is because you can't do anything with any ResultSet without first moving the cursor to a row. However, you can use a query to find out how many rows a query will return without having to iterate through the whole query ResultSet by using the count SQL function.
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can use select count(*) as my_count from table_name to get the number of row count from a table.

rs.getInt("my_count") will return you number of rows..



 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all of us.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic