The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

<!--  Presentation generated by Internet Assistant for Microsoft PowerPoint 97 -->

<HTML>
<HEAD>

<meta name="GENERATOR" content="Microsoft Internet Assistant for Microsoft PowerPoint 97">
 <TITLE>Picking up the Pieces</TITLE> 
</HEAD>

<BODY     >

<CENTER>
<TABLE WIDTH=100%> 
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <A HREF="sld001.htm">First</A>&nbsp;&nbsp;
         <A HREF="sld045.htm">Previous</A>&nbsp;&nbsp;
         <A HREF="sld047.htm">Next</A>&nbsp;&nbsp;
         <A HREF="sld102.htm">Last</A>&nbsp;&nbsp;
&nbsp;&nbsp;         <A HREF="index.htm">Index</A>&nbsp;&nbsp;
         <A HREF="dbi.perl.org">Home</A>&nbsp;&nbsp;
         <A HREF="tsld046.htm">Text</A>&nbsp;&nbsp;
     </TD> </TR>
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <IMG SRC="img046.gif" usemap="#Objmap" WIDTH=800 HEIGHT=600 BORDER=0>
     </TD> </TR>
</TABLE>
<P>Slide 46 of 102</P>
</CENTER>
<!-- <UL>
<H2>Picking up the Pieces</H2>
</UL></P>
<P><UL>
<LI><H2>So, what went wrong?
</H2>
<UL>
$@
<BR><UL>
<LI>holds the text of the error message
</UL>if ($DBI::err && $@ =~ /^(\S+) (\S+) failed: /)
<UL>
<LI>then it was probably a DBI error
<LI>and $1 is the driver class (e.g. DBD::foo::db), $2 is the name of the method (e.g. prepare)
</UL>$DBI::lasth
<UL>
<LI>holds last DBI handle used (not recommended for general use)
</UL>$h-&#062{Statement}
<UL>
<LI>holds the statement text associated with the handle (even if it’s a database handle)
<LI>
</UL></UL></UL><UL>
<LI><H2>$h-&#062{ShowErrorStatement} = 1
</H2>
<UL>
<LI>appends $h-&#062{Statement} to RaiseError/PrintError messages:
<LI>DBD::foo::execute failed: duplicate key [for ``insert …’’]
<LI>for statement handles it also includes the $h-&#062{ParamValues} if available.
<LI>Makes error messages much more useful. Better than using $DBI::lasth
<LI>Many drivers should enable it by default. Inherited by child handles.</UL></UL></P>
<P>  -->
</Body>
</HTML>