ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » REPLACE : WMB

Post new topic  Reply to topic
 REPLACE : WMB « View previous topic :: View next topic » 
Author Message
jugadu
PostPosted: Sun Oct 12, 2008 9:54 pm    Post subject: REPLACE : WMB Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Sun Oct 12, 2008 10:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jugadu
PostPosted: Sun Oct 12, 2008 10:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Sun Oct 12, 2008 11:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » REPLACE : WMB
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.