<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
code
        {font-family:"Courier New";}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>I have a problem I hope you can give me some advice on.</span></font></p>

<p class=MsoNormal><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>My organization is going thru a conversion from Sybase to
DB2. We have cgi framework written in perl that has depends on the sybperl
exported routines <a name="item_dberrhandle"><code><font face=Tahoma><span
style='font-family:Tahoma'>dberrhandle</span></font></code></a><code><font
face=Tahoma><span style='font-family:Tahoma'> and dbmsghandle. The framework
traps all database errors, formats an error message and returns the message to
the users browser. None of the hundreds of scripts that utilize the framework
perform manual error checking. </span></font></code></span></font></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>&nbsp;</span></font></code></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>The conversion to DB2 will require that we switch to using
DBI. Apparently DBI does not provide the exported routine technique for
handling error conditions. The closest thing I can find is setting PrintError
and RaiseError when the db connection is established and then using $SIG{__WARN__}
and $SIG{__DIE__} to redirect the messages for formatting and display. </span></font></code></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>&nbsp;</span></font></code></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>I also read that using this technique should be a last
resort. Does anyone have a suggestion of how to implement a centralized error
handling technique similar to the sybperl exported routine approach or is the
__DIE__ method my only option?</span></font></code></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>&nbsp;</span></font></code></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>Bill Wood</span></font></code></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>UCSD Administrative Computing</span></font></code></p>

<p class=MsoNormal><code><font size=3 face=Tahoma><span style='font-size:12.0pt;
font-family:Tahoma'>wwood@ucsd.edu</span></font></code></p>

</div>

</body>

</html>