> On Tue, Aug 15, 2000 at 03:26:03PM +0400, Vladislav Safronov wrote: > > Hi, > > > > Could you have a look at the lines and answer the question .. > > --- > > sub foo { > > my $dbh = shift; > > > > my $sql = ... > > > > my $sth = $dbh->prepare($sql); > > $sth->execute; > > $sth->finish; > > } > > === > > Do I always need to call $sth->finish? > > You *never* need to call finish on non-select statements. > (If you do, it's a driver bug.) > > > Wouldn't it be automaticly called when > > sub foo ends (when my variable $sth get destroyed)? > > Finish marks the end of *fetching*, not the end of life of the handle. So I can freely overwrite the handle with new one, since it's not the end of life of the handle, can't I? == my $sql = "select .." my $sth = $dbh->prepare($sql); $sth->execute; .. fetch just some (not all) data my $newsql = "select .." $sth = $dbh->prepare($newsql); $sth->execute; == and this code should work with troubles ... Vlad.
- Re: HTML Template Comparison Sheet ETA Perrin Harkins
- Re: HTML Template Comparison Sheet ETA Matt Sergeant
- Content negotiation Was: Re: HTML Temp... David Hodgkinson
- Question about $sth->finish; Vladislav Safronov
- Re: Question about $sth->fi... Matt Sergeant
- RE: Question about $sth-&g... Vladislav Safronov
- RE: Question about $s... Matt Sergeant
- Re: Question about $sth-&g... Keith G. Murphy
- Re: Question about $s... Matt Sergeant
- Re: Question about $sth->fi... Tim Bunce
- Re: HTML Template Comparis... Vladislav Safronov
- Re: HTML Template Comparison Sheet ETA Drew Taylor
- Re: HTML Template Comparison Sheet... Nelson Correa de Toledo Ferraz
- Re: HTML Template Comparison S... Drew Taylor
- Re: HTML Template Comparison S... Sam Tregar
- Re: HTML Template Comparis... Nelson Correa de Toledo Ferraz
- Re: HTML Template Com... Matt Sergeant
- Re: HTML Template... brian moseley
- Re: HTML Template... Matt Sergeant
- Re: HTML Template... brian moseley
- Re: HTML Template... Matt Sergeant