[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::odbc_rdb_driver

Title:DEC ODBC Driver
Notice:DEC ODBC Driver V2.0 Now Available
Moderator:SQLSRV::MAVRIS
Created:Tue Dec 29 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1357
Total number of notes:4864

1312.0. "Digit cut off when fetching negative real value using ODBC" by AVMSV1::EKREISLE (Erich Kreisler) Wed Mar 19 1997 10:45

Hello,

One of our customers found that when a real value is fetched using ODBC from Rdb
and this value is negative the last digit of the exponent gets stripped away.

Based on the information the customer sent to me the ODBC SDK 2.10 Appendix D
sepcifies a length of 13 for SQL_REAL (a sign, 7 digits, a decimal point, 
the letter E, a sign, and 2 digits) but our ODBC driver returns 8 digits and 
when the value is negative the last digit of the exponent is lost.

Here is an extract from a ODBC logfile

<BOUND>
        6
        SQL_C_CHAR
        [13]-8.3936000E-0 <--Error
        14
        16

I can provide a complete log if needed. 

Versions: Rdb 6.1-03
	  SQL/Services 6.1-01
	  ODBC 2.0.20/2.10.11

The problem happens only in MSQuery because it gets the data in chracters and 
not as reals.
Question: is this a known problem (did not find it here in notes or UK WWS) ?

Ciao,
	erich
T.RTitleUserPersonal
Name
DateLines
1312.1known probM5::JBALOGHWed Mar 19 1997 11:3210
    Yes, this is a known problem with MS Query or any ODBC app that fetches
    REAL or DOUBLE data types into chars. 
    
    The precision for an Rdb DOUBLE or REAL is more that the spec allows.
    The ODBC driver specifies 13 chars for REAL but Rdb is sending it 14 
    so the driver has to cut 1 off to meet the spec. 
    
    Not much can be done except to get Microsoft to change the ODBC spec. 
    
    John  
1312.2M5::JBALOGHWed Mar 19 1997 11:335
    One thing you may be able to do is to CAST the REAL to another data
    type such as integer or char. You could do this is in a query or in a
    view. 
    
    John
1312.3AVMSV1::EKREISLEErich KreislerWed Mar 19 1997 11:5611
>    The ODBC driver specifies 13 chars for REAL but Rdb is sending it 14 
>    so the driver has to cut 1 off to meet the spec. 
>Not much can be done except to get Microsoft to change the ODBC spec.

So we do not conform to the ODBC spec in that area. My opinion is that this is
our problem and not the problem of MS if we do not conform to ODBC Spec.

On the other hand is this documented anywhere (Ichecked but did not find it).

Any more information welcome,
	erich
1312.4M5::JBALOGHWed Mar 19 1997 13:2411
    The point was that we DO conform to the spec. The ODBC spec says we
    have to return 13 characters. The driver returns 13 characters. 
    
    The problem is that Rdb carries a greater precision than the ODBC spec
    allows so something has to go. I really don't think Rdb engineering is
    going to reduce precision in Rdb to match the Microsoft spec. 
    
    I guess the real question is going to be... What does SQL92 say about
    length of a real?
    
    John
1312.5documented...M5::JBALOGHWed Mar 19 1997 18:196
    BTW: 
    
    This behavior is documented in the readme.txt file that ships with ODBC
    driver.      
    
    John
1312.6AVMSV1::EKREISLEErich KreislerFri Mar 21 1997 11:537
Re .-1

I hope the customer accepts what we have documented.
I also recommended to use the workarounds described in that document.

Ciao,
	erich
1312.7Digit cut off when fetching negative real value using ODBCataxp1.at.oracle.com::RROEHRICOracle AustriaMon Mar 24 1997 09:076
The customer doesn't accept the workaround, casting the real.
In his opinion the odbc-driver should convert the real or truncate one
precision-digits and not truncate the exponent.

	Regards
		Reinhold
1312.8Bug 471042148.87.13.1::EKREISLEErich KreislerFri Mar 28 1997 10:540