|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
REPLACE : WMB |
« View previous topic :: View next topic » |
Author |
Message
|
jugadu |
Posted: Sun Oct 12, 2008 9:54 pm Post subject: REPLACE : WMB |
|
|
Apprentice
Joined: 04 Dec 2007 Posts: 30
|
Hi,
I am migrating JAVA code to ESQL code...
TRGT_DESCRIPTION = TRGT_DESCRIPTION.replaceAll("'","''");
above function in Java will replace the ' to ''.....
same function in ESQL i have writen like this..
SET TRGT_DESCRIPTION = REPLACE(TRGT_DESCRIPTION, ''', '''')
its throwing some syntax error.....could u please tell how replace ' to '' |
|
Back to top |
|
 |
elvis_gn |
Posted: Sun Oct 12, 2008 10:01 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi jugadu,
Since the single quote is a special character you need to specify another single quote to identify it...similar to how \ is used with a single \ in Java for strings.
Hence, for " ' " you will need to replace it with " '' " ...and since double quotes are replaced by single quote in esql, eventually you will need to use ' '' '.
Hope i'm right, haven't written esql code for few months now
Regards. |
|
Back to top |
|
 |
jugadu |
Posted: Sun Oct 12, 2008 10:43 pm Post subject: |
|
|
Apprentice
Joined: 04 Dec 2007 Posts: 30
|
thanks for ur reply...
whatever u told correct we need to use ' '' '
but problem is how to define '''....for this its trowing syntax error |
|
Back to top |
|
 |
elvis_gn |
Posted: Sun Oct 12, 2008 11:35 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi jugadu,
jugadu wrote: |
but problem is how to define '''....for this its trowing syntax error |
I don't get you...you want to replace 3 single quotes ?
Ok, one of the below must fit what you need...
' replace with '' (2 for 1)
'' replace with '''' (4 for 2)
''' replace with '''''' (6 for 3)
and so on...
Mind you, I have not considered your single quotes to indicate string...so for that you need to add 2 more single quotes.
Regards. |
|
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
|
|
|
|