Interesting, Devel::Peek is a look into the internals of Perl that I never thought I'd need to see. Not as disturbing as watching sausage being made but some gory details about variable storage exposed with this method.

To see how nulls in the DB ('undef' as far as Perl is concerned) look when dumped, I added a fifth column (E) to the database table with a null value and added that to the query and dumped output. It seems that Dump sends its output to stderr and so I had to comingle the output streams when running this from a DOS command prompt (and then edit the result to collate the two streams). This is the result of the first case where the Single database columns containing values expressed in scientific notation (columns B & C) are returned with a "missing" value (a null byte--not quite the same as an empty string):

a=6.02518 SV = PV(0x277ae34) at 0x47d2b4 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x275664c "6.02518"\0 CUR = 7 LEN = 10 COW_REFCNT = 1 b= SV = PV(0x277ae5c) at 0x47da94 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x275672c "\0"\0 CUR = 1 LEN = 10 c= SV = PV(0x277ae54) at 0x47da34 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x27567ac "\0"\0 CUR = 1 LEN = 10 d=8.99280607700348E-2 SV = PV(0x277ae4c) at 0x47d134 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x28ac1bc "8.99280607700348E-2"\0 CUR = 19 LEN = 21 COW_REFCNT = 1 e= SV = PV(0x277aeac) at 0x47d1f4 REFCNT = 1 FLAGS = () PV = 0

As expected, in the second query where I added zeros to the columns (A+0, B+0, C+0, D+0, E+0) in the query, the problematic B and C columns are recast as double precision values and show up properly and look normal using Dump(). I'm not much on Perl internals and haven't needed to immerse myself in perlguts just yet so I'm hoping that something in the output above sheds some light on why Single values expressed in scientific notation cannot seem to be reliably returned with a fetch using DBI.


In reply to Re^2: Problems with values expressed in scientific notation not being returned through DBI by DazedConfuzed
in thread Problems with values expressed in scientific notation not being returned through DBI by DazedConfuzed

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.