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
[EMAIL PROTECTED]    Tel: +44 1223 334506, Fax: +44 1223 334679

Reply via email to