Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Sun, 27 Mar 2005 @ 03:29:12 GMT

  <Prev Next>  
Next> Last>>  

Subj:   2616 numeric overflow while calculating huge numbers
From:   Pandey, Vivek

Hi All,

I am populating a DECIMAL (18, 2) column by doing a computation as below.

     COALESCE (CAST ((t1.amount * t2.rate) AS DECIMAL (18, 2)), 0.0)

The issue is some of the 'amount' values in t1 when multiplied with 'rate' value in t2 go beyond the Teradata max decimal limit. For e.g. a combination like below.

     T1.A                  T2.B
     -1815091030215.00     1633986.92810458

Here T1.A * T2.B = -2965835016691185249.4598847

What should be done to avoid this, any thoughts?

Putting a where condition like

WHERE (T1.A * T2.B) < 9999999999999999.99 will not help as anyway the product needs to be calculated before comparison which will again cause 2616 error.

Thanks & Regards


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