in reply to Querying databases in a loop
This way you won't get a performance hit for re-preparing the SQL statement every time.foreach my $x (@checklists) { my $sth = $dbh->prepare_cached("SELECT word FROM $x WHERE word = ? +"); $sth->execute($word); my $ret = $sth->fetchrow_hashref(); ...etc... }
|
|---|