From the DBI doc:
$ary_ref = $dbh->selectall_arrayref($statement, \%attr, @bind_values);Update: thanks to Happy-the-monk for clarifying what the notation actually means. I thought the OP would understand it, seeing how he used an anonymous hash himself. What the docs actually say is:
$ary_ref = $dbh->selectall_arrayref($statement); $ary_ref = $dbh->selectall_arrayref($statement, \%attr); $ary_ref = $dbh->selectall_arrayref($statement, \%attr, @bind_values);
This means that the selectall_arrayref method takes either one, two, or any number of arguments. The first two have to be scalars, a string (SQL query) and a reference to a hash (attributes). After that, you can supply a list of values for the placeholders in your query, if any.
In reply to Re: Using placeholders in selectall_arrayref
by Fang
in thread Using placeholders in selectall_arrayref
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |