|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
String Manipulation |
« View previous topic :: View next topic » |
Author |
Message
|
SDS |
Posted: Tue Oct 18, 2011 10:25 pm Post subject: String Manipulation |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
If a string consists of another string more than a single times as highlighted below.
e.g
22903a1234567893ahhdwi927903ayi9ou90009874563a222c3a1234567893a45iyioyowqdj222c..
How can we SUBSTRING both the strings and REPLACE it with some other value??
I have tried but it only SUBSTRING & REPLACE the 1st portion & the 2nd portions remains unchanged but I have to change the both.
How can I do it?? |
|
Back to top |
|
 |
ruchir |
Posted: Tue Oct 18, 2011 10:47 pm Post subject: |
|
|
Guest
|
Hi,
Plz post how u r doing it, thne it will be easy to solve your problem. |
|
Back to top |
|
 |
SDS |
Posted: Tue Oct 18, 2011 11:00 pm Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
I am using SUBSTRING functions to find out & filter out the highlighted portion from the string and the using REPLACE to modify it.
Like in MRM we use CARDINALITY to check the number of times a same field appears and then use it as counter to assign with new values. Is there any way like that in BLOB/CHAR string?? |
|
Back to top |
|
 |
ruchir |
Posted: Tue Oct 18, 2011 11:09 pm Post subject: |
|
|
Guest
|
Hi,
If you are using REPLACE function you need not substring.
Just chck the functionality of replace function and it will easily do your job of replacing the desired string from your source string.
Your code will be like
Code: |
REPLACE('22903a1234567893ahhdwi927903ayi9ou90009874563a222c3a1234567893a45iyioyowqdj222c.. ','123456789','your string'); |
|
|
Back to top |
|
 |
mqjeff |
Posted: Wed Oct 19, 2011 2:20 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You also should be strongly considering creating a message definition instead of doing all of this parsing manually. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|