Forgot the '$sth->execute;'. Whoops. I'm sure
you'd figure it out eventually anyway though :)
> -----Original Message-----
> From: Wilson, Doug [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 05, 2001 10:12 AM
> To: 'Sterin, Ilya'; 'raptor '; '[EMAIL PROTECTED] '
> Subject: RE: selectall_hashref()
>
>
>
> > From: raptor
>
> > I want a litle more extended sytax for selectall_hashref(),
> > or if u can
> > tell
> > me how the achieve this :
> >
> > my $Query = qq{SELECT field1, field2, field3};
> > my $res = $dbh->selectall_hashref($Query, {field1=>1,
> > field2=>1}, %attr)
> > so as a result i get the following HoH :
> >
> > $$res{field1}{field2} = $field3;
>
> You're going to have to do this yourself in a fetch loop
> (unless you supply the patches to Tim yourself :)
>
> E.g.:
>
> my $sth = $dbh->prepare($Query);
> $sth->bind_columns(\my ($field1, $field2, $field3));
> my %res;
> while ($sth->fetch) {
> $res{$field1}{$field2} = $field3;
> }
>
> HTH,
> Douglas Wilson
>