You r hitting the Exception when No-Data-Found and that is Not Being captured. Would See the function like this ....
Begin Begin Select set return value. exception set return value. end return return value end
create or replace function t1 return number
is
v_exists number(5):=0;
begin
select 1
into v_exists
from dual where 1 = 0;
return v_exists;
--exception
-- when others then
-- v_exists := '999';
-- return 999;
end t1;
/
select t1 from dual;
Expected: ORA-01403: no data found
Actual:
fraud_owner@E2E811> select t1 from dual
2 /
T1
----------
fraud_owner@E2E811>
IMPORTANT: The contents of this email and any attachments are confidential and proprietary to ECtel Ltd. They are intended for the named recipient(s) only. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, use, distribution or copying of this communication is strictly prohibited and may be unlawful.
If you have received this email in error, please notify us immediately by replying to the message and deleting it from your computer.
-- ----------------------------------------------------------- http://iyertalks.blogspot.com/