Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 26 Jul 2002 @ 16:48:04 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Dec(18,0)
From:   Geoffrey Rommel

  It works fine with Teradata ODBC driver (version  

  333333333333333500, "2002-07-26", "CCCC ", 300  

I'm concerned that you may not have grasped the implications of the previous responses. Let's call the value as it is stored in Teradata T, and the value as it is displayed in Queryman Q. If T is exactly 333333333333333500, it will certainly look as if the row was returned correctly, because that is the value to which ODBC will round T; i.e. T will be = Q. But if T is, say, 333333333333333505, ODBC will still round it to 333333333333333500, so T != Q. As the Perl script below demonstrates, 64-bit floating-point fields cannot hold 18- digit numbers.

$y = pack('d', 333333333333333500);
$z = pack('d', 333333333333333505);
print "y ", unpack('H*', $y),"\n";
print "z ", unpack('H*', $z),"\n";

Output (under MP-RAS):
y 5885349af3809243
z 5885349af3809243

Note that the floating-point fields contain exactly the same value.


  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023