Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: NO NO_DATA_FOUND ?!?!
Marcin Buchwald <Marcin.Buchwald_at_agora.pl> writes:
> The function
>
> create function noex
> return number
> as
> n number;
> begin
> select 1 into n from dual where 0=1;
> n := 4; -- not executed!
> return n;
> end;
>
> should raise an NO_DATA_FOUND exception in my opinion. It answers
> NULL however and ignores the rest of body code. The example concerns
> pl/sql functions in general.
This is hard to believe. I suppose your problem is elsewhere:
SQL> create function noex
return number
as
n number;
begin
select 1 into n from dual where 0=1;
n := 4; -- not executed!
return n;
end; 2 3 4 5 6 7 8 9
10 /
SQL> variable x number
SQL> exec :x:= noex
BEGIN :x:= noex; END;
*
ERROR at line 1:
ORA-01403: no data found ORA-06512: at "ISB.NOEX", line 6 ORA-06512: at line 1Received on Sat Jun 02 2001 - 20:09:54 CDT