On 5/3/06, Bill Moseley <[EMAIL PROTECTED]> wrote:

How do I get the column names as a list to match the order of the
rows returned when using select/fetchall_arrayref and using an ARRAY
slice?  I'm not having luck finding it in the docs.

I don't know the column names ahead of time -- I'm passed a query and
want to return the data in the column order specified in the query.
And also return the list of column names.


Doesn't fetchall_arrayref return you a reference to an array of rows, each
row of which is itself an array.  So, you fall back on $sth->{NAMES} for the
list of column names.

Your subject line only mentions selectall_arrayref - so maybe you're really
planning to use that.  If so, you need to read the fine print about if
selectall_arrayref being passed a prepared statement handle - and then use
that and $sth->{NAMES} again.


--
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

Reply via email to