Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Default Question (Resent)
Morning,
This is untested and off the top of my head, and it is still quite early in the morning, and it is raining, so :
begin
....
begin select a into num1 from t1; exception when no_data_found then num1 := 0; end; begin select b into num2 from t2; exception when no_data_found then num2 := 0; end; ... exception stuff here
You have to code each access to the database in it's own begin/exception/end block otherwise that fact that there is no data to select will cause the procedure to barf.
HTH
Regards,
Norman.
Tel: 0113 289 6265 Fax: 0113 289 3146 URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: abc [mailto:abc_at_abc.com.au]
Posted At: Wednesday, February 26, 2003 3:41 AM
Posted To: server
Conversation: SQL Default Question (Resent)
Subject: SQL Default Question (Resent)
Hi All,
I have a PL/SQL to do following calculation:
Total = NUM1 + NUM2;
SELECT a INTO NUM1 FROM T1;
SELECT b INTO NUM2 FROM T2;
<SNIP> Received on Wed Feb 26 2003 - 03:52:28 CST