A couple of comments.

First, the table is defined as a "float", and with Sybase that means IEEE float if the platform supports it. As such it's an imprecise data type (and one that I would NOT use for money amounts!). You will almost by definition get data that is different from what you insert.
For example, I created a dummy table with a single float column, and inserted your 999999999999.0012 value. Running a select on that value with sqsh gives me 999999999999.001221.

Second - when you fetch a float value DBD::Sybase will store that internally as a perl "numeric" value (an NV). There shouldn't be any loss of precision there, but it's a float, so, as stated above, there are no guarantees.

For handling precise amounts (financial transactions, etc) I would strongly recommend using either the Sybase MONEY datatype (which is an 8 byte value with an implied 4 decimal places) or using a NUMERIC datatype.

Michael


In reply to Re: Re: Bug in DBI? (Surely Not??) by mpeppler
in thread Bug in DBI? (Surely Not??) by Kevman

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.