develooper Front page | perl.dbi.users | Postings from July 2006

Execute marks end of transaction?

Thread Next
From:
Jimmy Li
Date:
July 10, 2006 20:38
Subject:
Execute marks end of transaction?
Message ID:
2b199aaf0607102037l8746917tb0c2f3904ed0a6e1@mail.gmail.com
Can I end a transaction as soon as I call execute()? or do I have to wait
until I finish fetching all the rows?

For example, I have:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    $dbh->do("start transaction");

    my $groups_query = $dbh->prepare(qq{select id, name from staff_grp});
    $groups_query->execute;

# place1

    while (my @one_group = $groups_query->fetchrow_array)
    {
        print @one_group;
    }

#place 2

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Can I end the transaction in #place1 or do I have to wait until #place2?

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About