Perl DBI : prepare function [message #34411] |
Fri, 10 December 2004 00:51 |
Ultra
Messages: 98 Registered: November 2003
|
Member |
|
|
<A name=pgfId=1030540>[/url]$sth = $dbh->prepare("SELECT truc, machin FROM table WHERE bidule=?");
$sth->execute( $bidule );
while ( @ligne = $sth->fetchrow_array ) {print "@lignen";}
Hello, I've a DBI-perl-program with 4 distinct sql requests.
Always the same are called many time in each loop.
Do you think it's a good idea to create many $sth, like this
$sth1 = $dbh->prepare("SELECT truc, machin FROM table1 WHERE bidule=?");
$sth2 = $dbh->prepare("SELECT truc, machin FROM table2 WHERE bidule=?");
$sth3 = $dbh->prepare("SELECT truc, machin FROM table WHERE bidule=?");
and called them when it's necessary. That mean the object will stay open
during long long time, and I won't destroy $sth1 before using $sth2
Does it affects the Oracle Database to keep during few hours this kind of objects
Thank you.
|
|
|