Help ?!?!?

Using DBI I call a PL/SQL package and hand it some variables. This package does some validation of the data, when the package is not happy with the data an SQL error is raised.

What I want to do is instead of having DBI die, I want to see the error in a variable so I can process this and send back an error to the user.

The variables are handed in via a webpage and errors should be returned on that page (thus the dislike of a die)

I have seen some solutions to this, but these usualy use a eval{} to solve the problem. Due to the application framework that I'm forced to work in this will not work as a die is always caught before my code can get to it.

So what I wat is a way to find the errors returned without death.

The ways I have atempted to get these errors from the DBI are:
- my $error = $dbh->errstr;
- my $error = $@

The problem is that both are always undefined no matter how may errors the package returns. So my question is how do I find the errors without having the DBI calling die

This is my config:
- Perl v5.6.1 built for sun4-solaris
- DBI DBI version 1.34
- Oracle DBD complited with Oracle 8.1.7 client

In reply to DBI - PL/SQL error catching by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.