Today i came across an issue in informatica code which i have figured out the solution for it. But i don’t have a proper justification and not sure if my solution is a proper fix.
Here is the summary of my issue:
Source: Flatfile (Fixed Width)
Source Field Datatype: String 14
Target: SQL Server Table
Targer Field Datatype: Decimal (14,2)
Old Logic IIF (TO_DECIMAL(FIELDNAME),TO_DECIMAL(FIELDNAME)/100,NULL)
Bad data 00002631064132
Error Message: Transformation Evaluation Error [<> [TO_INTEGER]: integer overflow ... i:TO_INTEGER(f:TO_FLOAT(d2:TO_DECIMAL(u:'00002631064132',i:-100)),i:0)]
Updated Logic IIF(NOT ISNULL(LTRIM(RTRIM(FIELDNAME))),TO_DECIMAL(FIELDNAME)/100,NULL)
Output 26310641.32 (Loaded as Expected)
Issue Summary
We have the initial logic (Old Logic) which converts the string to decimal(14,2).
This code has been running without any issues since from a while. But today this load has failed with integer overflow (Error).
I have changed the logic as show in the picture(Updated logic) and it loaded the data successfully with expected output(Output).
My doubt is why there is to_integer, to_float showed up in the error when i’m not using anywhere in my mapping. I’m looking for proper justification for this fix.
Any thoughts?
Thanks in advance!!
TO_DECIMAL()
function? Is this a custom function? This is tagged as sql-server, but I do not think this function is part of SQL Server. Also,ISNULL()
would expect 2 arguments in SQL Server. – Matthew I