in reply to selectall_hashref

Have you tried breaking it down and using fetchall_hashref instead? EG:
my $sql = "select Col1, Col2, Col3 from TABLE where Col4 = 1"; my $dbq = $dbh->prepare($sql); $dbq->execute or die "Could not execute $sql:$!\n"; my $ref = $dbq->fetchall_hashref('Col1');

Replies are listed 'Best First'.
Re^2: selectall_hashref
by mnlight (Scribe) on Jan 05, 2006 at 04:52 UTC
    Just tried doing the fetchall_hashref and got this error. "Can't locate object method "fetchall_hashref" via package DBI::st"
    Why does this stuff always happen to me?
      Which version of DBI do you have?

      From perldoc DBI::Changes, it appears that support for the fetchall_hashref method was added in version 1.20 (August 2001). If you don't have at least this version then you may want to grab the latest version.

      Cheers,
      Darren :)

      What version of DBI do you have?
        I don't know how do I determine it.
      Why does this stuff always happen to me?

      Trust me - you're not the only one...