Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: PL/SQL Exception
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 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: kumanan.balasundaram_at_qxl.com 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: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Wed May 09 2001 - 12:51:14 CDT
(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: udaycb_at_trwasp.com 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: ListGuru_at_fatcity.com (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).
![]() |
![]() |