-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> 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.

It's a little hidden, but we already have this:

$sth = $dbh-prepare($SQL);
$sth->execute(@vals);
$rows = $sth->fetchall_arrayref({});

for (@$rows) {
  print "I am row $_->{id} with a value of $_->{fnord}\n";
}

- --
Greg Sabino Mullane [EMAIL PROTECTED]  [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200601100745
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFDw6zbvJuQZxSWSsgRAnu5AJ9Y6oKiBtS4CzHyY1pQDKtedoG4sQCfcGcD
9jZF9frISXkjo4xqGps+DaE=
=l+IS
-----END PGP SIGNATURE-----


Reply via email to