0
votes

I have an Input port in expression transformation which is middle name field with datatype as string(10). I am using some data quality checks on it and o/p port is having dataype as char(1).

So for eg: If middle name is KUMAR, It should pass only K in output port as I have selected datatype as STRING(1) in O/P port.

But I see, It is not getting truncated and KUMAR is passing through in data. But if I use a variable port in the same expression and give it as STRING(1) and use value received from Variable port in another output port, I see only K letter going through in data.

Why is this happening?

1
There is something you've missed e.g. maybe you set the scale of the port to 1 instead of the precision, what you've described doesn't fit with the numerous truncation errors I've seen. Even assuming what you've described was true, when the output port feeds the value to the next string 1 input port it would truncate there - Daniel Machet

1 Answers

0
votes

It seems to be very direct requirement. Please use the substr fn as below

substr(middlename,1,1).

Take this value as the o/p port. I hope this should help.