in reply to Re^4: DBI hashref does not return data in order of query
in thread DBI hashref does not return data in order of query

Not an DBI question anymore, then. Let's give XML::Writer a chance:

Assuming your data is in the @ordered_values array:

use XML::Writer; my $writer = XML::Writer->new( NEWLINES=>0, DATA_MODE=>1, DATA_INDENT= +>2, ); $writer->startTag("dataset"); for(my $i=0; $i< @ordered_values;$i++) { my $row = $ordered_values[ $i ]; $writer->startTag("row", "num" => $i); for(my$j=0; $j < @$row; $j++) { $writer->startTag("cdr", "name" => $names[$j]); $writer->characters( $row->[ $j ] ); $writer->endTag(); } $writer->endTag(); } $writer->endTag(); $writer->end();

Replies are listed 'Best First'.
Re^6: DBI hashref does not return data in order of query
by hallikpapa (Scribe) on Oct 29, 2007 at 03:51 UTC
    This did it. I really appreciate your help!