开发者

FreeTDS translating MS SQL money type to python float, not Decimal

I am connecting to an MS SQL Server db from Python in Linux. I am connecting via pyodbc using the FreeTDS driver. When I return a money field from MSSQL it comes through as a float, rather than a Python Decimal.

The problem is with FreeTDS. If I run the exac开发者_JAVA百科t same Python code from Windows (where I do not need to use FreeTDS), pyodbc returns a Python Decimal.

How can I get back a Python Decimal when I'm running the code in Linux?


You could always just convert it to Decimal when it comes back...


It was a bug in FreeTDS. The bug has been fixed in the CVS head of FreeTDS as of August 4, 2010 (thanks Freddy Ziglio). See my post on the web2py message board for more info.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜