Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 06 Jan 2003 @ 15:17:31 GMT


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


Subj:   Re: Number overflow occured during computation
 
From:   Anomy Anom

<-- Anonymously Posted: Monday, January 06, 2003 09:58 -->

Hi

The reason you are getting overflow errors is that your result data type is not probably what you expect.

If you multiply two dec(15,2) columns, the result is a dec(15,4). The resulting data type operates within tighter bounds than dec(15,2). You can see what the result will be by using the TYPE (COLUMN_A * COLUMN_B) function.

Also, sum can also cause the result to be a different datatype

You may need to consider casting the columns as floats and possibly recasting the result back to a suitable form for your application.

There is an example below which may work. However, you may need to tweak it.

(sum(cast(l_ijkl as float) * (1 - cast(l_mnop as float))
* (1 + cast(l_qrst as float))) ) (decimal(15,2)) as sum_ofcol

Good luck



     
  <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