Re: Informix Decimals and ODBC
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET
Allan Gould wrote: > > 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. The default Informix decimal is actually 16,0. The default Informix money is 16,2. Cheers, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com http://www.informix.com/idn |///// / //| |http://www.iiug.org +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 838250 2325 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+
"Mark D. Stock" wrote: > > Allan Gould wrote: > > > > donfranke@my-dejanews.com wrote: [snip] > > 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. > > The default Informix decimal is actually 16,0. The default Informix > money is 16,2. Oops! Sorry. Thanks for pointing out my slip-up. However, in terms of the ODBC datatype mapping, the issue is still relevant.