sql% rowcount

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc

Poston Thu, 04 Jan 2007 9:48 am

I was wondering if the sql command% rowcount only returns rows procesados by DML statements, it does not work for a select?

ex: select count(*) from <table>
Location: Brasília-DF

Cleber Zumba de Souza

Poston Thu, 04 Jan 2007 10:12 am

% RowCount returns the number of rows returned from a FETCH on the cursor. If you make a cursor with SELECT COUNT (*), it will return 1, because it is returning only 1 row in the cursor. (how many)

Another thing you can do is tell how many records are affected by an UPDATE. Hence, we use SQL% ROWCOUNT.
Code: Select all
  set ok='x'
  where ok='S';
in this case, the output is the amount of rows that the update did.
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?

Return to SQL

Who is online

Users browsing this forum: No registered users and 3 guests