Thanks for the reply. I updated the original post in this thread accidently, but I will mention it here. It's reporting all of the data back properly, but it is not putting the column headers as the element tags, they are all coming back as <anon> still, which is clear because I am not pushing the @names array into @ordered_values, or the XMLout at all. And since there is like 500 records returned, I wanted to put each record in cdr tags, and surrounded by the dataset root tag. This is how it is running right now.
my @names = @{ $sth->{NAME} }; my @ordered_values = (); while ( my $row = $sth->fetchrow_arrayref ) { push @ordered_values, [@$row]; } my $cgi = CGI->new; print $cgi->header('text/xml'); print "-- DBI says:\n"; print XMLout( \@ordered_values, NoAttr=>1, RootName=>'dataset', ); print "\n"; print "-- dumper says:\n"; print Dumper(\@names); print Dumper(\@ordered_values);
This is what it returns.
<anon> <anon>AAAABUcKyqQhEAABI34stA.4515613</anon> <anon>989</anon> <anon>OQ-OZDN-D-UHMC-UHMC-0939</anon> <anon>MQ-MTBO-T-CCDPN-FTQ-1737</anon> <anon>9895555555</anon> <anon>MI</anon> </anon>
Thank you for your paitence!

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.