Digging a bit deeper, just to satisfy my own curiosity (as I could not remember lower-casing the headers), here's the cause of your column name folding:

From the SQL::Statement manual pages:

· Wildcards are expanded to lower cased identifiers. This mig +ht confuse some people, but it was easier to implement. The warning in DBI to never trust the case of returned colu +mn names should be read more often. If you need to rely on identifie +rs, always use "sth->{NAME_lc}" or "sth->{NAME_uc}" - never rel +y on "sth->{NAME}": $dbh->{FetchHashKeyName} = "NAME_lc"; $sth = $dbh->prepare ("SELECT FOO, BAR, ID, NAME, BAZ FRO +M TABLE"); $sth->execute; $hash_ref = $sth->fetchall_hashref ("id"); print "Name for id 42 is $hash_ref->{42}->{name}\n"; See "FetchHashKeyName" in DBI for more information.

As select * from selects on a wildcard, this situation comes into effect. I'll add an explicit note to the docs of DBD::CSV.

Note in case of DBD::CSV that you can check what the driver's view on reality is by inspecting $dbh->{csv_tables}{tablename}{col_names}. My test showed me that this still holds the original folding.

Personally, I always use NAME_lc in all my database interfaces, so I never hit this problem.


Enjoy, Have FUN! H.Merijn

In reply to Re^4: DBD::CSV works with text, but not numbers by Tux
in thread dbi::CSV works with text, but not numbers by Sandy_Bio_Perl

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.