Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 06 Jan 2003 @ 16:42:37 GMT


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


Subj:   Re: Number overflow occured during computation
 
From:   Matthew Winter

Hi,

Multiplying two dec(15,2) fields would generate a dec(18,4) field.

The quick test would be something like:

SELECT
    CAST(100.00 AS DECIMAL(15,2)) * CAST(100.00 AS DECIMAL(15,2)) AS C1
  , TYPE(C1)

This returns:

C1          Type(C1)
10,000.0000 DECIMAL(18,4)

The rule tends to be to add the two precision values together, with a maximum value of 18, and use this as the target precision value. The two scale values are also added together, to form the target scale value, if the target scale value is greater than 18, then a "2614: Precision loss during expression evaluation" error is generated.

For example DEC(5,2) * DEC(5,2) = DEC(10,4)


Regards

Matthew Winter

Technical Architect
TPG IS Design Authority
Teradata Certified Professional



     
  <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