Another prepare_cached() example
 
 
- Can also be used for dynamically constructed statements:
- 
- 
 while ( ($field, $value) = each %search_fields ) {
 push @sql,   "$field = ?";
 push @values, $value;
 }
 $where = "";
 $where = "where ".join(" and ", @sql) if @sql;
 $sth = $dbh->prepare_cached("select * from table $where");
 $sth->execute(@values);
 
- but beware caching too many variations because, for many databases, each statement handle consumes some resources on the server (e.g. a cursor)