trapping no records on update [message #39902] |
Thu, 22 August 2002 05:31 |
John Bonin
Messages: 3 Registered: August 2002
|
Junior Member |
|
|
I'm trying to implement a counter of the number of records not updated in one table from a cursor loop in
another table.
for test in tmpcursor
loop
id := test.dbid;
update othertable
set newid = id
where dbid = id;
-- right here I want to check for sqlcode = 100 if the
-- data wasn't found to update and add to counter.
end loop;
Any ideas how to do this?
Thanks,
John
|
|
|
Re: trapping no records on update [message #39903 is a reply to message #39902] |
Thu, 22 August 2002 06:32 |
Rick Cale
Messages: 111 Registered: February 2002
|
Senior Member |
|
|
Use SQL%ROWCOUNT, this returns # of rows affected on
last DML statement. You could initialize a variable to
0 and just do variable := variable + SQL%ROWCOUNT to
keep a cumulative total.
|
|
|
|