hi,
the string is "注意:这张订单取代了我们之前的订单#xxxxxxxxx。 请在发票中注明新的" we have to replace xxxxxxxxx with the coressponding key column. like this
注意:这张订单取代了我们之前的订单#BKL2345001。 请在发票中注明新的|
, this key colunm value will change for each row.
currently i am using Convert('xxxxxxxxxx', Xfm_DuplicateCAAPS_IN.PORDNUMB,Xfm_DuplicateCAAPS_IN.Chinese_text)
but, the output i am getting is
注意:这张订单取代了我们之前的订单#BBBBBBBBBB。 请在发票中注明新的
instead of
注意:这张订单取代了我们之前的订单#BKL2345001。 请在发票中注明新的|
and the datatype is varchar Unicode
thnx
replacing a part of unicode chinese string, with a string
Moderators: chulett, rschirm, roy
replacing a part of unicode chinese string, with a string
Last edited by sendmkpk on Fri Mar 19, 2010 3:23 am, edited 1 time in total.
The convert function works on a single character, not a string and won't work for you in this case. You might use this:
Code: Select all
svKeyPosition INDEX(Xfm_DuplicateCAAPS_IN.Chinese_text,'xxxxxxxxxx')
NewString[svKeyPosition,10]=Xfm_DuplicateCAAPS_IN.PORDNUMB
great,ArndW wrote:The convert function works on a single character, not a string and won't work for you in this case. You might use this:
Code: Select all
svKeyPosition INDEX(Xfm_DuplicateCAAPS_IN.Chinese_text,'xxxxxxxxxx') NewString[svKeyPosition,10]=Xfm_DuplicateCAAPS_IN.PORDNUMB
i am still did not understand what to do with index function, can anyone help me with the exact code. i will be thankful.
I just realized that I cut-and-pasted an incorrect line 2. The first line is a stage variable that is an integer which gives the starting position of the substring. The second line should be:
Code: Select all
IF svKeyPosition THEN Xfm_DuplicateCAAPS_IN.Chinese_text[1,svKeyPosition-1]:Xfm_DuplicateCAAPS_IN.PORDNUMB:Xfm_DuplicateCAAPS_IN.Chinese_text[svKeyPosition+10,9999] ELSE Xfm_DuplicateCAAPS_IN.Chinese_text
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Search out the parallel version of Ereplace() that was posted on DSXchange. Use this instead of Convert() which, as Arnd noted, only operates on one character.
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.