prepare_cached()
$dbh->prepare_cached($sql_standard[, \%attr, $active])
This function creates a statement handle like
prepare() does, but it stores the resulting
statement handle in a hash. Attributes for the statement handle may be
given in the second argument in the form of a hash. The third argument
of the method changes the behavior of the handle if an active
statement handle is already in the cache. Table 18-1 lists the four choices for this
argument.
The statement handle that this method generates is used in
basically the same way as the statement handle generated by
prepare(). However, it can potentially cause
system problems if not used properly. Therefore, use
prepare() instead.
Active value | Result |
0 | Warning messages will be issued, and
|
1 | No warning will be displayed, but
|
2 | Disables checking for an active handle. |
3 | Causes the new statement handle to replace the active one. |