This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
Subject: Question about $sth->finish;
From: "Vladislav Safronov" <vlads@comptek.ru>
Date: Tue, 15 Aug 2000 15:26:03 +0400
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? Wouldn't it be automaticly called
when
sub foo ends (when my variable $sth get destroyed)?
===
Subject: Re: Question about $sth->finish;
To: Vladislav Safronov <vlads@comptek.ru>
From: Matt Sergeant <matt@sergeant.org>
Date: Tue, 15 Aug 2000 13:41:21 +0100 (BST)
On Tue, 15 Aug 2000, 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? Wouldn't it be automaticly called
> when
> sub foo ends (when my variable $sth get destroyed)?
$sth doesn't always get destroyed when foo ends (due to a bug in all
perls). But otherwise, yes.
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org
===