On 11-Jul-2006 Jimmy Li wrote:
> Can I end a transaction as soon as I call execute()?
Yes
> or do I have to wait
> until I finish fetching all the rows?
No
> For example, I have:
>
> ------------------------------------------------------------------------------
> ------------------------------------------------------------------------------
> ----------
> $dbh->do("start transaction");
>
> my $groups_query = $dbh->prepare(qq{select id, name from staff_grp});
> $groups_query->execute;
>
># place1
$groups_query->finish if (want_to_stop_here);
>
> 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?
See above.
Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com