Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 12 Apr 2007 @ 13:19:03 GMT

  <Prev Next>  
Next> Last>>  

Subj:   Decimal (18,0) magic
From:   Longauer Juraj


I have a table with column decimal(18,0) in which I want to store large generated key. I have discovered strange behaviour when working with the number stored in it. See examples below. When I use decimal(16,0) everything is ok. I have a suspision that 2 places are reserved for the decimal separator and sign and decimal(16,0) is maximum for storing numbers. Can someone add more light to this?

     drop table decimal_test;
     create set table decimal_test (a decimal(18,0))
     insert decimal_test(a)
     values (222222333333444444);

This select returns number which is different from the one I have inserted:

     select * from decimal_test
     where a = 222222333333444444;


     222222333333444448 - through jdbc connection
     222222333333444450 - odbc connection - sql assistant

     select * from decimal_test
     where a = '222222333333444444';

I get following error:

Precision error in FLOAT type constant or during implicit conversions. _



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