I've declared a cursor c3 that I know pulls back no rows at the moment, however when I run the procedure I keep getting the message 'Rows deleted'. I've checked the no of rows with SQL%ROWCOUNT and get 1 as the result. Can anyone explain why and how I should be writing the code??
for rec in c3 loop
delete from tester where dbid=rec.dbid;
end loop;
if SQL%NOTFOUND then
dbms_output.put_line('No rows to delete');
else
dbms_output.put_line('Rows deleted');
end if;
