Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 77058
Status: rejected
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.616
Fixed in: (no value)



Subject: Feature request: selectall_arrayref, etc, return the statement handle too
Currently $dbh->selectall_arrayref returns a single scalar, which is an array reference of the results. It would be useful for it to return the statement handle too: ($ary_ref, $sth) = $dbh->selectall_arrayref($statement); The caller could then fish out statement attributes from $sth if wanted. In scalar context, it would still return just the results arrayref, so this would be backwards compatible. selectall_hashref and selectcol_arrayref should similarly return the sth.
On Tue May 08 06:50:46 2012, EDAVIS wrote: Show quoted text
> Currently $dbh->selectall_arrayref returns a single scalar, which is
an Show quoted text
> array reference of the results. It would be useful for it to return
the Show quoted text
> statement handle too: > > ($ary_ref, $sth) = $dbh->selectall_arrayref($statement); > > The caller could then fish out statement attributes from $sth if
wanted. Show quoted text
> In scalar context, it would still return just the results arrayref, so > this would be backwards compatible. > > selectall_hashref and selectcol_arrayref should similarly return the
sth. I'm not totally sure the automatically created stmt in your example above is guaranteed to exist after selectall_arrayref returns. Just prepare the statement first and pass it to selectall_arrayref instead of the sql. Martin -- Martin J. Evans Wetherby, UK
Thanks for the suggestion, but Martin's explanation is correct.