bigperm has asked for the wisdom of the Perl Monks concerning the following question:
Hey all...
I think I've found a stumbling block for myself, but I'd like to find out if there's something I don't know before I start making lots of changes.
We recently changed column names to a shorter format, and in most of our code we are currently using a "table.column" format.
I have been a big fan of fetchrow_hashref for a while, and so I've used it in many, many, many places.
So now, when I get my hash back, the keys look like this:
"address_1" "city" "state"
...when I need them to look like this:
"address.address_1" "address.city" "address.state"
The two changes I am considering are to: 1)use a fetchrow_array, and list my values out; or 2)use " AS " in my SELECT statements. I hate both options.
Is there a way to tell MySQL and/or the DBI that I want the table.column format in my hash keys?
There is another question out there that is similar to mine, but the answer wasn't what I was looking for, and I just want to know if there is a better solution for me.
Here is that link:
How do I get "table.column" format from a select/join?Thanks so much,
Dale
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fetchrow_hashref, and table.column format
by bradcathey (Prior) on Dec 20, 2005 at 19:30 UTC | |
by bigperm (Novice) on Dec 20, 2005 at 19:43 UTC | |
|
Re: fetchrow_hashref, and table.column format
by rnahi (Curate) on Dec 20, 2005 at 20:53 UTC | |
|
Re: fetchrow_hashref, and table.column format
by jeffa (Bishop) on Dec 20, 2005 at 18:29 UTC | |
|
Re: fetchrow_hashref, and table.column format
by holli (Abbot) on Dec 20, 2005 at 18:45 UTC |