Welcome Guest ( Log In | Register )


 
 
 
 
 
 

 
 
Oracle 

Performance Tuning Reference poster
 
Oracle training in Linux 

commands
 
Oracle training Weblogic Book
 
Easy Oracle Jumpstart
 
Oracle training & performance tuning books
 
Burleson Consulting Remote DB Administration
 
 
 
Reply to this topicStart new topic
> How to get No. Row Selected
hapytran
post Dec 30 2007, 09:44 PM
Post #1


Member
**

Group: Members
Posts: 13
Joined: 12-October 05
Member No.: 3,107



Hi,

In oracle, is there any way to get number of row selected after run a query? For example, using sql plus, after running select * from table_name, the last row of result is "x row selected". I know that Implicit cursors: SQL%ROWCOUNT returns number of rows affected by SQL statement, but it seems only effect to insert, update, delete sql statement.


Thanks
Go to the top of the page
 
+Quote Post
Starikovsky
post Dec 31 2007, 04:38 AM
Post #2


Advanced Member
***

Group: Members
Posts: 119
Joined: 13-November 07
Member No.: 13,939



That's correct.
SQL%ROWCOUNT returns number of rows affected by Insert, Update, Delete and SELECT INTO statements.

If you are working on SQLPLUS just set feedback parameter with a threshold of one...

SET FEEDBACK 1

...now every single command including SELECT will report number of affected rows.
Go to the top of the page
 
+Quote Post
HAL9000
post Dec 31 2007, 09:08 AM
Post #3


Advanced Member
***

Group: Members
Posts: 879
Joined: 25-September 07
Member No.: 12,336



"In oracle, is there any way to get number of row selected after run a query?"

SQL*Plus - Set feedback on and set autotrace on

PL/SQL - select into collection and count array members
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 1st September 2014 - 06:16 AM