perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angus Lees <...@inodes.org>
Subject Re: Add: Re: Re: UPD: output table with variable data
Date Fri, 21 Feb 2003 21:58:14 GMT
At Fri, 21 Feb 2003 12:59:13 +0100, Alexander Hartmaier wrote:
> Because I use a hash instead of an array now I've got the problem that sorting
> with an ORDER BY sql statement is useless ;_(((
> 
> I don't want to loose the pros of using a hash (i can reference an the columns
> per name and if I add a new one don't need to touch the others).
> Hast anybody an idea how to handle this problem?
> I thought of a second array which holds the order of keys of the hash....

use an array of hashes.  $sth->fetchall_arrayref({}) (note the empty
hash ref) should give you the right thing.

if you don't actually want to look at the data again, it would be
better to do the fetch inside the table loop. that way you never store
all the results in memory, and you can start processing before the
query is finished.

you could also use something like DBIx::Recordset to get somewhere in
between those two.

-- 
 - Gus

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message