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> a écrit dans le message news:
3B00E4E2.EB532A59_at_agora.pl...
> 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.
>
> I need tho catch NO_DATA_FOUND in pl/sql function.
> What to do?
>
> Marcin.
>
create or replace function noex
return number
as
n number;
begin
select 1 into n from dual where 0=1;
n := 4; -- not executed!
return n;
exception
when no_data_found then
return 0;
end;
/
-- Have a nice day MichelReceived on Tue May 15 2001 - 03:36:27 CDT
![]() |
![]() |