On Mon, Mar 14, 2005 at 10:06:51AM -0800, Zhuang Li wrote: > Sure, Tim. I'll do it as soon as I get a chance.
DBI 1.48 is out now. I added a t/11fetch.t file with some basic tests. That's the one to patch. Tim. > Thanks, > > john > > > -----Original Message----- > > From: Tim Bunce > > Sent: Saturday, March 12, 2005 5:11 AM > > To: Zhuang Li > > Cc: [email protected]; Tim Bunce HM; Daniel S. Lewart > > Subject: Re: Patch for fetchall_hashref with multiple column key > > > > 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 > > > > > > >
