All Forums Database
ravimans 54 posts Joined 02/14
08 Aug 2014
Numeric overflow issue

Hi,
I am getting the below given error but the table from which i am selecting the value has datatype as decimal and the table which i am inserting also has datatype as decimal but while inserting it's giving the below error. I tried to convert it to numeric and varchar but still facing the same issue. I used TRIM function also so that if any space is there it will be trimmed but still facing the same issue.
       *** Failure 2616 Numeric overflow occurred during computation.
                      Statement# 1, Info =0
       *** Total elapsed time was 27 seconds.

Raja_KT 1246 posts Joined 07/09
08 Aug 2014

Check once again the precision. If you can share the source and its data type and the target and its datatype.
To avoid re-work, I am posting a reference of the past posts of our friends here. It may help you identify.
https://forums.teradata.com/forum/database/numeric-overflow-error-in-teredata
 

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

ravimans 54 posts Joined 02/14
10 Aug 2014

Hi,
Source details as follows:
Col1 Decimal(5,0)
Col2 Decimal(5,0)
Target details as follows:
Col1 Decimal(9,0)
Col2 Decimal(9,0)
Col3 Decimal(3,0)
but one thing i noticed is few of the values comes as MINUS value but i tried to convert like this,
CAST(CAST(TRIM(Col1) AS DECIMAL) AS INTEGER)
 

Raja_KT 1246 posts Joined 07/09
10 Aug 2014

With col1 and col2 precisions , given , it works fine when  I do 
insert into target select col1,col2 from source;
Btw, casting decimal to integer, means losing precision. It may not be what business want.
 

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

krishaneesh 140 posts Joined 04/13
11 Aug 2014

is Col3 populated by doing a substraction from col1 and col2? if so there might be a value in either col1 or Col2 which upon doing a minus gives a decimal which is greater than Decimal(3,0) and less than Decimal(5,0). Define Col3 as Decimal(5,0) and verify.

You must sign in to leave a comment.