in reply to Re: Bug in DBI? (Surely Not??)
in thread Bug in DBI? (Surely Not??)
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
|
|---|