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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Q: any idea what are we missing ?

Re: Q: any idea what are we missing ?

From: Niall Litchfield <niall.litchfield_at_gmail.com>
Date: Wed, 20 Sep 2006 13:53:54 +0100
Message-ID: <7765c8970609200553g730fa83ai341a75722c59345@mail.gmail.com>


It isn't being raised, which I think is the point.

I'd prefer if you expect an exception to deal with it, and otherwise reraise

eg

NIALL @ nl102 >ed
Wrote file afiedt.buf

  1 create or replace function tst return number   2 is
  3 v_exists number(5):=0;
  4 begin

  5     select 1
  6       into   v_exists
  7       from dual where 1 = 0;
  8       return v_exists;
  9  exception
 10       when no_data_found then
 11               v_exists := '0';
 12       return v_exists;
 13       when others then
 14       raise;

 15* end tst;
NIALL @ nl102 >/

Function created.

NIALL @ nl102 >select tst from dual;

       TST


         0

1 row selected.

NIALL @ nl102 >

note that no exception handling results in a null return

NIALL @ nl102 >ed
Wrote file afiedt.buf

  1 create or replace function tst return number   2 is
  3 v_exists number(5):=0; begin

  4       select 1
  5         into   v_exists
  6         from dual where 1 = 0;
  7         return v_exists;

  8* end tst;
NIALL @ nl102 >/

Function created.

NIALL @ nl102 >select tst from dual;

       TST


1 row selected.

NIALL @ nl102 >

On 9/20/06, rjamya <rjamya_at_gmail.com> wrote:
> what is the point? you are not catching the exception, so why complain when
> it is raised?
>
> Raj
>
>
>
> On 9/20/06, Amihay Gonen < AmihayG_at_ectel.com> wrote:
> >
> >
> >
> >
> >
> > create or replace function t1 return number
> >
> > is
> >
> > v_exists number(5):=0;
> >
> > begin
>
>

-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Sep 20 2006 - 07:53:54 CDT

Original text of this message

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