or selectall_arrayhashref? 

Anyway, I rather frequently find that the "most natural" way to
represent a query result is an array of hashes: Each row is hashref, but
the the rows are in an array(ref) so that the order is preserved, and
the columns can be accessed by name.

Proposed use:

my $emp = $dbh->selectall_hasharrayref("select * from emp order by ename");

for (@$emp) {
    print "$_->{ename} ($_->{empno}): $_->{job}\n";
}

or

for ($first .. $last) {
    print $emp->[$_]{ename}, "\n";
}

or something like that.

What do you think?

        hp

-- 
   _  | Peter J. Holzer    | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR       | I'd be programming in Java.
| |   | [EMAIL PROTECTED]      | I don't, and I'm not.
__/   | http://www.hjp.at/ |   -- Jesse Erlbaum on dbi-users

Attachment: pgpuJM7iSMH8i.pgp
Description: PGP signature

Reply via email to