I've got a column defined as this:
Column("cost", Numeric, nullable=False)
In Oracle, it seems I can't take advantage of the Decimal() class. I
get rounding errors as if using float instead of Decimal, see output
for Oracle vs. Postgres.....
************Oracle 8i (use_ansi=False):
>>> itl.cost
Decimal('8.99')
>>> itl.cost = Decimal('5.99')
>>>
>>> DBSession.flush()
16:21:48,090 INFO [sqlalchemy.engine.base.Engine.0x...4c10] UPDATE
inventorytransactions SET cost=:cost WHERE
inventorytransactions.transactionid = :inventorytransactions_tr_1
16:21:48,090 INFO [sqlalchemy.engine.base.Engine.0x...4c10]
{'inventorytransactions_tr_1': 'AAAFD2AAEAAACN/AAA', 'cost':
5.9900000000000002}
>>>
************postgres:
>>> DBSession.flush()
16:30:03,357 INFO [sqlalchemy.engine.base.Engine.0x...4ad0] UPDATE
inventorytransactions SET cost=%(cost)s WHERE
inventorytransactions.transactionid = %
(inventorytransactions_transactionid)s
16:30:03,357 INFO [sqlalchemy.engine.base.Engine.0x...4ad0] {'cost':
Decimal('5.99'), 'inventorytransactions_transactionid': 'A'}
Am I doing something wrong?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.