Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: No of rows affected in a SQL statement?

Re: No of rows affected in a SQL statement?

From: <gdas_at_my-deja.com>
Date: Thu, 17 Aug 2000 18:24:34 GMT
Message-ID: <8nhak8$dr8$1@nnrp1.deja.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US