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;
}
==

Vlad.

Reply via email to