Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: DBI specification change

by giulienk (Curate)
on Jul 16, 2002 at 11:33 UTC ( #182044=note: print w/ replies, xml ) Need Help??


in reply to Re: DBI specification change
in thread DBI specification change

I guess the method fetchall_arrayofhashref isn't provided for performance issues (mapping the keys to every hash at once). Anyway, knowing the columns names (as you should), you can mimic the behavior of the method you want with something like this:

my @fields = qw(name surname); my $select = sprintf 'SELECT %s FROM clients', join(',', @fields); my @arr_of_hashes = map {my %hash; @hash{@fields} = @$_; \%hash} @{ $dbh->selectall_arrayref($select) };


$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g


Comment on Re: Re: DBI specification change
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://182044]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-07-12 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls