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>Let the DBI cache your handles</TITLE> 
</HEAD>

<BODY     >

<CENTER>
<TABLE WIDTH=100%> 
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <A HREF="sld001.htm">First</A>&nbsp;&nbsp;
         <A HREF="sld021.htm">Previous</A>&nbsp;&nbsp;
         <A HREF="sld023.htm">Next</A>&nbsp;&nbsp;
         <A HREF="sld080.htm">Last</A>&nbsp;&nbsp;
&nbsp;&nbsp;         <A HREF="index.htm">Index</A>&nbsp;&nbsp;
         <A HREF="http://dbi.perl.org">Home</A>&nbsp;&nbsp;
         <A HREF="tsld022.htm">Text</A>&nbsp;&nbsp;
     </TD> </TR>
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <IMG SRC="img022.gif" usemap="#Objmap" WIDTH=800 HEIGHT=600 BORDER=0>
     </TD> </TR>
</TABLE>
<P>Slide 22 of 80</P>
</CENTER>
<!-- <UL>
<H2>Let the DBI cache your handles</H2>
</UL></P>
<P><UL>
<LI><H2>Sometimes it's not easy to hold all your handles
</H2>
<UL>
<LI>e.g., library code to lookup values from the database
<LI>
</UL></UL><UL>
<LI><H2>The prepare_cached() method gives you a client side statement handle cache:
</H2>
<UL>

<BR><BR>sub lookup_foo {
<BR>    my ($dbh, $id) = @_;
<BR>    $sth = $dbh-&#062prepare_cached("select foo from table where id=?");
<BR>    return $dbh-&#062selectrow_array($sth, $id);
<BR>}
<BR>
</UL></UL><UL>
<LI><H2>Can avoid the need for global statement handle variables
</H2>
<UL>
<LI>which can cause problems in some situations, see later</UL></UL></P>
<P>  -->
</Body>
</HTML>