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