Re: Oracle procedure raises exception but looks to be successful from DBI



On 25/01/08 15:25, Martin Evans wrote:
Hi,

I've just spent a long time tracking down a bug in an Oracle procedure because DBI's execute method returned success even though the procedure raised an exception. Shouldn't exceptions raised in procedures cause execute to fail?

[ snip ]

my $s = $h->prepare("call proctest(?)");

This is nothing to do with Perl. It is native Oracle behaviour.

If you use the SQL CALL statement to call a procedure,
"No data found" exceptions will be quietly ignored.

This is specific to CALL and to the "No data found" exception.

Oracle support have insisted that it is not a bug. It is part
of the same mechanism by which

select (select * from dual where 0=1) from dual

returns a null value rather than an exception.

I have been severely burnt buy this, and now avoid CALL altogether.

--
Charles Jardine - Computing Service, University of Cambridge
cj10@xxxxxxxxx Tel: +44 1223 334506, Fax: +44 1223 334679
.



Relevant Pages

  • Re: Choosing not to throw exceptions like IllegalArguementException
    ... preventing debug from happening at all. ... like a recipe for converting easily debugged problems into subtle wrong ... Imagine the TreeCellRenderer wich throw an exception, and prevent the JTree from any repaint success, only because some bug happened before, which broke a specific assumption, and now there is the "impossible case" happening. ...
    (comp.lang.java.programmer)
  • Re: Find rare bugs - SEH and c++ exception handling
    ... Unfortunately the bug occurs only "on the read" it's not that easy (or ... I can't introduce MessageBoxes because they ... It really seems that I neet a lot of patience. ... When the kernel detects an application exception, ...
    (microsoft.public.pocketpc.developer)
  • Re: Choosing not to throw exceptions like IllegalArguementException
    ... preventing debug from happening at all. ... like a recipe for converting easily debugged problems into subtle wrong ... Imagine the TreeCellRenderer wich throw an exception, and prevent the JTree from any repaint success, only because some bug happened before, which broke a specific assumption, and now there is the "impossible case" happening. ...
    (comp.lang.java.programmer)
  • Re: Why does this object need to be cast?
    ... >> If .NET throws an excpetion, it's a bug. ... only sew things up for which with managed code we have protection. ... writing low level classes, overiding operators and such, Exception handling ... The caller must do a silly try/catch or forward ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Find rare bugs - SEH and c++ exception handling
    ... you configure the emulator to display its debug console window for serial ... When the kernel detects an application exception, ... The bug is not reproducible and occours without user interaction (there ... VS2005 supports SEH as well as C++ exception handling. ...
    (microsoft.public.pocketpc.developer)