Wanted to know if the SQL% rowcount command only returns lines processed by DML statements, does it not work for a SELECT?
Ex:
Select Count (*) From <table>
sql% rowcount
-
- Rank: DBA Júnior
- Posts: 223
- Joined: Thu, 14 Dec 2006 10:45 am
- Location: Brasília-DF
Cleber Zumba de Souza
- dr_gori
- Moderador
- Posts: 5024
- Joined: Mon, 03 May 2004 3:08 pm
- Location: Portland, OR USA
- Contact:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
% Rowcount returns the number of rows returned from a fetch in the cursor. If you do a cursor with Select Count (*), it will return 1 as it is returning only 1 line of the cursor. (With the quantity)
Another thing that you can do is count how many records were affected by an update. Hence, we use SQL% Rowcount.
Example:
In that case, the output will be the amount of rows that the Update did.
Another thing that you can do is count how many records were affected by an update. Hence, we use SQL% Rowcount.
Example:
update SUA_TABELA
set ok='x'
where ok='S';
dbms_output.put_line(sql%rowcount);
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests