On Tue, 15 Aug 2000, Vladislav Safronov wrote:
> Ok. I think, the answers clear the problem, but I have yet more question.
>
> What can you say about this code? is it ok (overwriting previous handle)?
>
> ==
> sub foo {
> my $dbh = shift;
>
> my $sql1 = "select *...
> my $sql2 = "select *...
>
> my $sth = $dbh->prepare($sql1);
> $sth->execute;
> .. fetch some data.
>
> # should be $sth->finish inserted??
>
> $sth = $dbh->prepare($sql2); # we overwrite previous handle saved in $sth
> ..
> $sth->execute;
> .. fetch some data.
> return;
> }
It is my understanding of the DBI docs that you only need to call
$sth->finish when you DON'T fetch all the rows that the $sth has ready to
return.
--
-- Tom Mornini
-- InfoMania Printing and Prepress
- RE: Question about $sth->finish; Kenneth Lee
- RE: Question about $sth->finish; Henrik Tougaard
- RE: Question about $sth->finish; Vladislav Safronov
- RE: Question about $sth->finish; Matt Sergeant
- RE: Question about $sth->finish; Michael Peppler
- RE: Question about $sth->finis... Matt Sergeant
- RE: Question about $sth->f... Michael Peppler
- RE: Question about $sth->finish; Tom Mornini
- RE: Question about $sth->finish; Jay Jacobs
- Re: Question about $sth->finis... Tim Bunce
- RE: Question about $sth->finish; David Mitchell
- RE: Question about $sth->finish; Henrik Tougaard
- Re: Question about $sth->finish; Tim Bunce
- RE: Question about $sth->finish; Henrik Tougaard
- RE: Question about $sth->finish; Vladislav Safronov
