Home » SQL & PL/SQL » SQL & PL/SQL » How to know the number of affected rows?
How to know the number of affected rows? [message #36155] Thu, 08 November 2001 01:54 Go to next message
Marco Spadoni
Messages: 1
Registered: November 2001
Junior Member
Hello!
Does anybody know how to know the number of rows that
were affected by a statement like
UPDATE myTbl SET myColumnA=X WHERE myColumnB=Y;
or
DELETE FROM myTbl WHERE myColumnB=Y;
Thank you,
Marco Spadoni
Italia On Line
Pisa (ITALY)

----------------------------------------------------------------------
Re: How to know the number of affected rows? [message #36156 is a reply to message #36155] Thu, 08 November 2001 02:01 Go to previous message
Malli
Messages: 10
Registered: November 2001
Junior Member
Hi Marco Spadoni
Here is the solution for ur problem.
--------------------------------------------------
DECLARE
v_Count Number;
BEGIN
update tablename set columName=Value where condition;
v_count := sql%rowcount;
END;
--------------------------------------------------
sql%RowCount returns the number of rows affected

Malli

----------------------------------------------------------------------
Previous Topic: Win200 and Oracle
Next Topic: error PL/SQL select with database link
Goto Forum:
  


Current Time: Thu Mar 28 12:54:55 CDT 2024