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.
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.
Source details as follows:
Target details as follows:
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)
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.
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.