Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I know if UPDATE fails?

Re: How do I know if UPDATE fails?

From: Ed Prochak <edprochak_at_adelphia.net>
Date: Fri, 28 Feb 2003 22:11:44 GMT
Message-ID: <3E5FE241.9070304@adelphia.net>


Ubiquitous wrote:
> 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?
>

I know you got a solution, but just so you (and other readers) know WHY it did not happen the way you hoped. The NO_DATA_FOUND exception is only raised for a SELECT statement. There is not such exception on UPDATE, because it is perfectly legal and acceptable for an updte to touch zero number of rows.

HTH

-- 
Ed Prochak
running: http://www.faqs.org/faqs/running-faq/
family:  http://web.magicinterface.com/~collins
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Fri Feb 28 2003 - 16:11:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US