I have data going in form a Varchar field to a char field.
varchar 255 (from file) to char 5 (db2). Input string string 1234567(varchar255) is loaded to db2 table as 12345 (char5)
The last two digits in the string are truncated without a warning or a database error, WITHOUT WRITING ANY CODE is it posible to generate a warning or a database error for this scenario? any APT_*** setting that would do this?
Where does the truncate happen in datastage or in db2?
varchar to char truncate issue
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It doesn't really matter where it happens, there's just no way to shoehorn seven characters into a Char(5) column.
My guess would be that it happens in DataStage - you could check that easily enough by changing the target (or adding a second target) that is a text file.
My guess would be that it happens in DataStage - you could check that easily enough by changing the target (or adding a second target) that is a text file.
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.
I do not want to shoehorn seven characters into a char(5) column datastage does that by truncating the last two digits.ray.wurlod wrote:It doesn't really matter where it happens, there's just no way to shoehorn seven characters into a Char(5) column.
I am trying to detect the records that have the seven characters in the file. One way that I can do it is by finding the length of the string and passing it down a link if it is greater than 5 char.
I want to detect the record with seven characters without making a code change and have datastage throw a warning or a error when the 7 characters is fed to a char(5) column. Can this be done? My guess from your response is NO. Do correct me if you think I am wrong.
Note: The copy stage throws an warning that I am trying to get varchar 255 to a char(5). I use varchar 255 to read the delimited flat file. I am only need the warning/error on the record if the length of the string is greater than 5.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: