RE: Q: any idea what are we missing ?

  • From: "Amihay Gonen" <AmihayG@xxxxxxxxx>
  • To: "Mladen Gogala" <mgogala@xxxxxxxxxxx>
  • Date: Wed, 20 Sep 2006 16:54:00 +0300

It is simpilfied code for complex code , it was just send in order to
show an oracle strange behviour , the when calling function from select
statement the exception NO_DATA_FOUND is not raised.  While from PL\SQL
code , it is raised.


Thanks for the comments .

-----Original Message-----
From: Mladen Gogala [mailto:mgogala@xxxxxxxxxxx]
Sent: 20 September 2006 16:46
To: niall.litchfield@xxxxxxxxx
Cc: rjamya@xxxxxxxxx; Amihay Gonen; oracle-l@xxxxxxxxxxxxx
Subject: Re: Q: any idea what are we missing ?


On 09/20/2006 08:53:54 AM, Niall Litchfield wrote:
> 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
>

>  13       when others then
>  14       raise;
>  15* end tst;


There was a recent thread on Tom Kyte's blog devoted to the snippets
like this one. OK, he
was specifically talking about the "WHEN OTHERS" not followed by
"RAISE", but you aren't
doing anything here, you are catching an exception just to re-raise it
in the next line.
What in the world makes you catch exceptions just to re-raise them? I
would advise something
like this:

PRAGMA EXCEPTION_INIT(CONFUSE,-600);

and then

WHEN OTHERS THEN
     RAISE CONFUSE;
END;

That would be a great contribution to the clarity of the code and
wouldn't cause
any confusion.


--
Mladen Gogala
http://www.mgogala.com


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.
--
//www.freelists.org/webpage/oracle-l


Other related posts: