Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: No of rows affected in a SQL statement?
not sure if your question is related specifically towards PL/SQL. If so, I asked a similar question a couple weeks ago. I received an answer which worked very well.
In PL/SQL, after you process any statement, there is a implicit cursor called "sql"...and you can ask for the rowcount property of it. It works for updates, deletes, selects, inserts...
simply call it after the specified DML statement. You can set to to a variable or output it to the console using dbms_output.
ex:
begin
select * from table;
dbms_output.put_line(sql%rowcount ||' rows selected');
end;
Hope that helps,
Gavin
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Aug 17 2000 - 13:24:34 CDT