I've just started implementing prepare_cached into my scripts and my code is
similar to the example in the book
while ( ($field, $value) = each %search_fields ) {
push @sql, "$field = ?";
push @values, $value;
}
$qualifier = "";
$qualifier = "where ".join(" and ", @sql) if @sql;
$sth = $dbh->prepare_cached("SELECT * FROM table $qualifier");
$sth->execute(@values);
while (@ary = $sth->fetchrow_array ())
{
print join ('\t',@ary);
}
$sth->finish();
At the end of the example in 'Programming the Perl DBI' it says "The cache
can be accessed (and cleared) via the CachedKids attribute."
The question I have is where is it that I place CachedKids in order to clear
the cache. I have no idea how to use it and the book is vague and doesn't
have any example on where to put it.
Searching online I've seen it used like this $dbh->{CachedKids}; to like
this $dbh->CachedKids(\%myHash); but I need a little more detail. It may be
that I don't need to use it at all. If that's the case then please tell me.
Thanks for any help that can be provided,
Chad