Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: NO NO_DATA_FOUND ?!?!

Re: NO NO_DATA_FOUND ?!?!

From: Martin Drautzburg <drautzburg_at_altavista.net>
Date: 03 Jun 2001 03:09:54 +0200
Message-ID: <871yp2qsgt.fsf@altavista.net>

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 1
Received on Sat Jun 02 2001 - 20:09:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US