Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: using fetchrow_hashref

by extremely (Priest)
on Dec 30, 2003 at 19:45 UTC ( #317755=note: print w/ replies, xml ) Need Help??


in reply to using fetchrow_hashref

Try SELECT code,sum(number) AS sum_number FROM $serverTabl_4 GROUP BY code where you've explicitly given the calculated column a name.

I'm pretty sure that DBI doesn't have sexy handling to make up purty column names for the hash-refs. You're going to need to do that yourself or wind up with undef() for keys in your hashes.

updateYeah, merlyn nailed it much clearer than I and diotalevi is right... hashes is magical. :)

--
$you = new YOU;
honk() if $you->love(perl)


Comment on Re: using fetchrow_hashref
Select or Download Code
Replies are listed 'Best First'.
Re: Re: using fetchrow_hashref
by diotalevi (Canon) on Dec 30, 2003 at 20:00 UTC
    There is no such thing as an undef hash key. Perl treats the undef as an empty, defined string.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-07-29 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls