Dear All,
I'm novice to DataStage... I have problem converting data type, please help. I have a source field having SQL Type as NCHAR where as target field having SQL Type as VARCHAR, how can I do this in Transfaormer stage... doesn't look like existing built-in data type conversion will help.
best regards
Ramesh
Data Type Conversion - Please help
Moderators: chulett, rschirm, roy
DataStage does lots of data type conversion automatically. Leave the metadata on the source and the targets alone. Just import them from the database of your choice. If you route data from one column to the target normally it will do whatever conversion is necessary behind the scenes to get the data there. This is one of the strengths of DataStage.
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard! :D
One of the strengths of DataStage is that it's very tolerant of data type mismatches, as it doesn't use data types internally. So the correct way to perform this conversion, as Kim says, is to do nothing!
If you're really worried about it you could apply a Trim() or TrimB() function to the data value, to guarantee that trailing space is removed, but that's more for your peace of mind than necessary.
One of the strengths of DataStage is that it's very tolerant of data type mismatches, as it doesn't use data types internally. So the correct way to perform this conversion, as Kim says, is to do nothing!
If you're really worried about it you could apply a Trim() or TrimB() function to the data value, to guarantee that trailing space is removed, but that's more for your peace of mind than necessary.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Duke & Ray
Thanks for your inputs.
As you recommend I have left the data type of source & target fields to their defaults. The source field stores the values N or S of Data type NCHAR but when I check the target field (VARCHAR) in an Enterprise manager, I see a strange 'square' character. As Ray suggested to use TrimB function but no actual result. Any guess?
Thanks
Ramesh
Thanks for your inputs.
As you recommend I have left the data type of source & target fields to their defaults. The source field stores the values N or S of Data type NCHAR but when I check the target field (VARCHAR) in an Enterprise manager, I see a strange 'square' character. As Ray suggested to use TrimB function but no actual result. Any guess?
Thanks
Ramesh