How to truncate Chinese Char ?
Moderators: chulett, rschirm, roy
How to truncate Chinese Char ?
Hi All,
Is there any function or method we have in DataStage to truncate the value of Chinese Char from 100 to 50 ?
Please suggest me .
Is there any function or method we have in DataStage to truncate the value of Chinese Char from 100 to 50 ?
Please suggest me .
Thank you,
Anu
Anu
-
- Participant
- Posts: 34
- Joined: Tue Feb 26, 2013 9:36 am
- Location: Chicago
-
- Participant
- Posts: 34
- Joined: Tue Feb 26, 2013 9:36 am
- Location: Chicago
-
- Participant
- Posts: 34
- Joined: Tue Feb 26, 2013 9:36 am
- Location: Chicago
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The inbuilt functions that you are likely to use, like [1,50] or Substring(), or Left(), all operate on characters (not on bytes). So, provided you have specified the correct character map (the one used to encode the data, for example BIG5 or GB2312) then all should be well.
The error message does not appear to be about characters and substringing. Check your DB2 error manual to understand more fully what error code SQL0302N means and its probable resolution.
Please post your findings back here.
The error message does not appear to be about characters and substringing. Check your DB2 error manual to understand more fully what error code SQL0302N means and its probable resolution.
Please post your findings back here.
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 Ray,
I found the info from the link below and tried by changing the field type as nvarchar in DS and not changed in the table , so that could be a reason for failing again with same error .
"To resolve this issue, you can triple the original varchar precision and size, or you can change the data type to nvarchar."
http://pic.dhe.ibm.com/infocenter/caapp ... iable.html
I found the info from the link below and tried by changing the field type as nvarchar in DS and not changed in the table , so that could be a reason for failing again with same error .
"To resolve this issue, you can triple the original varchar precision and size, or you can change the data type to nvarchar."
http://pic.dhe.ibm.com/infocenter/caapp ... iable.html
Thank you,
Anu
Anu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That, in turn, really depends on whether the database specifies characters or bytes for storage. If bytes, then a multiplier is definitely indicated, and will usually occur automatically when the table definition is imported. We found with most encodings of Japanese data that a factor of 3 was correct; however if there is a prevalence of double-width characters in your Chinese data a factor of 4 may be more appropriate.
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.