Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
With that, I have a handful of questions:# connect parent $dbh->connect(...); #statement 1 $sth=$dbh->prepare($sql); $sth->execute; while(($var)=$sth->fetchrow_array) { # fork $pm->start and next; # connect child $dbh2->connect(...); #statement 2 $sth2->prepare($sql2); $sth2->execute; while(($var2)=$sth2->fetchrow_array) { # condition if($var) { # statement 3 that might not be called $sth3->prepare($sql3); $sth3->execute; while(($var3)=$sth3->fetchrow_array) { ... } $sth3->finish; } else { # statement 4 that might not be called $sth4->prepare($sql4); $sth4->execute; while(($var4)=$sth4->fetchrow_array) { ... } $sth4->finish; } } # finish statement 2 $sth2->finish; # disconnect child $dbh2->disconnect; # end fork $pm->finish; } # finish statement 1 $sth->finish; # disconnect parent $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI, prepare_cached, finish, and forks
by runrig (Abbot) on Feb 24, 2006 at 01:22 UTC | |
by Anonymous Monk on Feb 24, 2006 at 01:56 UTC | |
by jZed (Prior) on Feb 24, 2006 at 02:07 UTC | |
by Anonymous Monk on Feb 24, 2006 at 02:31 UTC | |
by jZed (Prior) on Feb 24, 2006 at 02:41 UTC | |
|