Informix Decimals and ODBC
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET
I am using Intersolv 3.11 ODBC driver, Informix 7.2 for SCO Unix, and IIS. Connection is fine, but now Informix decimal data is being returned to IIS as an adNumeric datatype. The problem appears to be how the ODBC driver maps Informix Decimal(16,2) datatypes (the Intersolv driver maps it to an ODBC Numeric (adNumeric) datatype.) Example: Informix ODBC (viewed in IIS) ---------------------------------------------------------------------- Datatype Decimal(16,2) adNumeric Value 4000.00 4 Value 20.50 20.5 When the value is mapped from Informix Decimal to ODBC adNumeric, from right to left all zeroes up to the first non-zero digit are stripped away. ODBC itself does support a Decimal datatype (adDecimal); it appears the problem though is to get the Informix driver to map to the decimal datatype also. Some info on this is at http://www.microsoft.com/accessdev/articles/Jet3ODBC.htm#DATATYPE It's hard for me to believe this is the first time this issue has come to surface. Any help would be most appreciated, Don -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
donfranke@my-dejanews.com wrote: > > I am using Intersolv 3.11 ODBC driver, Informix 7.2 for SCO Unix, and IIS. > Connection is fine, but now Informix decimal data is being returned to IIS as > an adNumeric datatype. The problem appears to be how the ODBC driver maps > Informix Decimal(16,2) datatypes (the Intersolv driver maps it to an ODBC > Numeric (adNumeric) datatype.) > > Example: > Informix ODBC (viewed in IIS) > ---------------------------------------------------------------------- > Datatype Decimal(16,2) adNumeric > Value 4000.00 4 > Value 20.50 20.5 > > When the value is mapped from Informix Decimal to ODBC adNumeric, from right > to left all zeroes up to the first non-zero digit are stripped away. > > ODBC itself does support a Decimal datatype (adDecimal); it appears the > problem though is to get the Informix driver to map to the decimal datatype > also. Some info on this is at > http://www.microsoft.com/accessdev/articles/Jet3ODBC.htm#DATATYPE > > It's hard for me to believe this is the first time this issue has come to > surface. > > Any help would be most appreciated, A brief thought. I think you'll find the ODBC standard specifies support for decimal(15,2). The default decimal in Informix is (16,2). Sometimes with some ODBC drivers you get problems with the datatype mapping as a result when the decimal type goes above the ODBC standard. Because Informix defaults to decimal(16,2) most ODBC drivers now go above and beyond the standard to accommodate this, but it may not be entirely watertight (and perhaps not predictable because it's outside the standard). However, it should be a good place for you to go looking. I suggest you need to talk to your ODBC driver vendor (Intersolv/Merant etc). Allan Gould SCO CID Support, Leeds, UK (allang at sco dot com) (Please remove anti-spam measures if replying)