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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to