4 messages in com.mysql.lists.perlRe: DBI and DBD::mysql pseudohash res...
FromSent OnAttachments
Dan Bolser18 Sep 2004 04:01 
Jochen Wiedmann18 Sep 2004 04:07 
Dan Bolser18 Sep 2004 04:40 
Dan Bolser21 Sep 2004 14:44 
Subject:Re: DBI and DBD::mysql pseudohash results set?
From:Dan Bolser (dm@mrc-dunn.cam.ac.uk)
Date:09/18/2004 04:40:13 AM
List:com.mysql.lists.perl

On Sat, 18 Sep 2004, Jochen Wiedmann wrote:

Dan Bolser wrote:

I was thinking about loading the rows of a $sth results set into a pseudohash so that the columns could be accessed by either the column name or the column index.

You are of course free to do so. But what is it good for? DBI already offers one or the other, on your choice, and I cannot remember a case where I need both at the same time. Besides, you always have the DBI metadata methods.

You are right, it should never be strictly necessary. However, I am thinking about a convenience function such as 'doQuery' (exported by my MySQL::Simple perl module).

In general (I think) it is convenient to only remember one function call 'doQuery', and have a very flexible results set returned.

In this way the user can hack together an sql report in a very short amount of time.

I will have to look into the metadata methods, as I am totally ignorant of this feature.

Thanks for your help.

Anybody know about the future stability of the pseudohash?

Cheers, Dan.