Numeric overflow issue


Numeric overflow issue


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.


Re: Numeric overflow issue

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.

Re: Numeric overflow issue


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,


Re: Numeric overflow issue

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.

Re: Numeric overflow issue

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.