[racket] Losing decimal in SQL Server query result

From: Galler (lzgaller at optonline.net)
Date: Thu Nov 1 13:10:57 EDT 2012

> Another possible workaround for now would be to cast the field to a 
> varchar and call string->number on the result.

numeric is an exact datatype in SQL Server; you'd also want to compose
inexact->exact with string->number to preserve exactness (if that's a concern) 

i.e (inexact->exact (string->number

I've also had challenges with bringing SQL Server's exact datatypes (numeric and
decimal) into racket via ADO using the new COM/FFI, and have used casting as a
workaround. I can't recall whether the earlier MysterX library had the same
issue, but I think the answer is no.

So, based on the two data points, I don't think the problem is your ODBC library
but possibly with the FFI. 

I'm happy to help with test cases if needed. I have SQL Server and Racket 5.3
set up here.


Posted on the users mailing list.