ODBC SELECT From Number Type Returns 0 On Windows 64-bit (Doc ID 944863.1)

Last updated on JULY 05, 2017

Applies to:

Oracle ODBC Driver - Version: 10.2.0.1.0 to 10.2.0.3 - Release: to 10.2
Microsoft Windows Itanium (64-bit)
Microsoft Windows x64 (64-bit)

Symptoms

The issue is with the 64-bit ODBC driver 10.2.0.1.0 running on 64-bit Windows.

Query any value from a number type column is returned as zero

-- Visual C# source code 
  
   Console.WriteLine("Input  Data = -123.45, -123.45, 123.45"); 
   cmd.CommandText = "INSERT INTO DECTEST VALUES(-123.45, -123.45, 123.45)"; 
   cmd.ExecuteNonQuery(); 
   cmd.Dispose(); 
 
   cmd = con.CreateCommand(); 
   cmd.Transaction = trn; 
   cmd.CommandText = "SELECT CLM1, CLM2, CLM3 FROM DECTEST"; 
   OdbcDataReader dr = cmd.ExecuteReader(); 
   while (dr.Read()) 
   { 
     Console.WriteLine("Output Data = " + dr[0].ToString() 
                                 + ", " + dr[1].ToString() 
                                 + ", " + dr[2].ToString()); 
   } 
  
 ---------------------------------------------------------- 
 
  [normal result] 
     Input  Data = -123, -123.45, 123 
     Output Data = -123, -123.45, 123 
 
  [wrong result] 
     Input  Data = -123, -123.45, 123 
     Output Data = 0, 0, 0

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms