Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I know if UPDATE fails?
create or replace procedure ab is
begin
update junk
set points=4
where points=5;
if sql%rowcount=0 then
dbms_output.put_line('not updated');
end if;
end;
"Ubiquitous" <weberm_at_polaris.net> wrote in message
news:b3h8b1$j4s$1_at_news.utelfla.com...
> This is probably a silly question, but I have a script which involves
> performing UPDATEs against a table. I was under the impression that
> using a NO_DATA_FOUND exception would catch any instances where
> the update failed because the row was not found, but that does not
> appear to be happening when I tested it. I suppose I could code a
> SELECT statement with the same criteria as the UPDATE and raise a
> NO_DATA_FOUND exception if it returns 0 rows (ie., the row is not
> found), but that seems to a round-about way to do this. Any ideas?
>
Received on Tue Feb 25 2003 - 20:53:18 CST