You can raise user defined exception when there are no records updated by
checking the value of SQL%ROWCOUNT.
for example

declare
x number;
no_data exception;
begin
        update a set c1 = 2 where c1 = 6;
        x := sql%rowcount;
        if x = 0 then
                raise no_data;
        end if;
exception
        when no_data then
                dbms_output.put_line('0 Rows Updated');
end;


Uday

-----Original Message-----
Balasundaram
Sent: Wednesday, May 09, 2001 12:46 PM
To: Multiple recipients of list ORACLE-L


Hi all,

Do you know if an exception is raised for "0 rows updated."
Take the following scenario but using PL/SQL.

select * from a;
C1
1
1
1
1

You get:
update a set c1 = 5 where c1 = 6;
0 rows updated.

Thanks
Kumanan


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Kumanan Balasundaram
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: udaycb
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to