Hi.
I got a problem with Decimal type on freebsd.
code:
from decimal import Decimal import _mssql def main(): con = _mssql.connect('194.247.133.1:1433', 'user', 'pass',) sql = u''' declare @megavar decimal(16,5) set @megavar = 1234567890.111222 select 1, @megavar ''' con.execute_query(sql) for row in con: print row con.close() if __name__ == '__main__': main()
result
#python ntype.py {0: 1, 1: 1234567890.1112199}
On windows decimal type helps to solve this problem.
F:\igor\apps\devel\python\mssql>python ntype.py {0: 1, 1: Decimal('1234567890.11122')}
How can I configure _mssql to use Decimal rather than float ?
setting tds version = 7.0
fixed the problem
Log in to post a comment.
Hi.
I got a problem with Decimal type on freebsd.
code:
result
On windows decimal type helps to solve this problem.
How can I configure _mssql to use Decimal rather than float ?
setting
tds version = 7.0
fixed the problem