Home » SQL & PL/SQL » SQL & PL/SQL » update exception handling
update exception handling [message #1667] Mon, 20 May 2002 22:05 Go to next message
hanu
Messages: 21
Registered: March 2002
Junior Member
How to do exception handling of an update command without a select command prior to that?

Here is the my case:

I am executing a update command if that query updates zero rows, I should proceed with X task else with Y task. My doubt is how to know the Update was sucessful for more than zero rows. I have tried with sqlcode.It's always returning value '0' irrespecive to UPDATE query success for zero rows or more.

Thanks in advance,
Hanu
Re: update exception handling [message #1668 is a reply to message #1667] Mon, 20 May 2002 22:32 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
update t
   set ...;
 
if sql%rowcount = 0 then
  x;
else
  y;
end if;
Previous Topic: Long Datatype
Next Topic: Time function in Oracle
Goto Forum:
  


Current Time: Thu Apr 25 09:21:52 CDT 2024