Multi-byte field disturbing the position of next fields
Posted: Wed Oct 03, 2012 3:47 pm
Hi,
We have few multi-byte columns. The field length(in terms of number of characters) is fixed. e.g., Address cannot be more than 5 character length but it can contain German special chracters(umlaut) in which case it might be more than 5 byte length.
Inorder to maintain same position for each field in a row, I have defined the datatype as char so it would add extra spaces to make it fixed length.
But here is the problem. If we consider all colums to be of char(5), we can notice in the 2nd row, when col3 contains special char - it pushed the next colum by 1 position. How can I avoid this?
I tried to get the Length in bytes so that I can manually calculate how many spaces to pad, but no function seem to give that value. I also read another posts and used Raw functions or len on raw string does not return the right results.
We have few multi-byte columns. The field length(in terms of number of characters) is fixed. e.g., Address cannot be more than 5 character length but it can contain German special chracters(umlaut) in which case it might be more than 5 byte length.
Inorder to maintain same position for each field in a row, I have defined the datatype as char so it would add extra spaces to make it fixed length.
But here is the problem. If we consider all colums to be of char(5), we can notice in the 2nd row, when col3 contains special char - it pushed the next colum by 1 position. How can I avoid this?
Code: Select all
Col1 Col2 Col3 Col4
XXX YYY TEST XXX
AAA BBB füR XXX