Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is there an equivalent to SQL%ROWCOUNT usable outside of PL/SQL?

536605Apr 19 2007 — edited Apr 20 2007
Is there a way to know the number of rows a previous SQL statement affected, outside of using PL/SQL. Example:

UPDATE TABLE1
SET COLUMN1 = 'X'
WHERE COLUMN1 <> 'X';

INSERT INTO TABLE1_LOG_HISTORY
( MESSAGE_COLUMN, DATE_TIME )
VALUES ('Table activity, rows were updated', SYSDATE)
WHERE sql%rowcount {or equivalent function} > 0;

I'm aware this can be done inside an anonymous procedure, but do not want to do it that way.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2007
Added on Apr 19 2007
2 comments
453 views