Thanks John. Any chance you could add some tests in the relevant t/*.t file?
[John has polished up the rough code I sketched out last January on dbi-dev in response to a request from Daniel Lewart.] Tim. On Thu, Mar 10, 2005 at 10:32:35AM -0800, Zhuang Li wrote: > I've made a patch to fetchall_hashref to handle multiple column key. > Selectall_hashref will inherit the > same result and syntax. Here is an example: > > For tables with a multiple columns primary key, an array reference > > can be specified: > > > > $sth = $dbh->prepare("SELECT date, account, revenue, profit FROM TABLE"); > > $sth->execute; > > $hash_ref = $sth->fetchall_hashref([qw(date account)]); # or $hash_ref > = > $sth->fetchall_hashref([1,2]); > > print "Revenue for account 42 on 2005-02-18 is > $hash_ref->{'2005-02-18'}{42}{revenue}\n"; > > > > > > Thanks, Tim, for answering my questions. > > > > > > Zhuang (John) Li