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 » How to remove the first matching string using esql

Post new topic  Reply to topic
 How to remove the first matching string using esql « View previous topic :: View next topic » 
Author Message
vijayakumar
PostPosted: Mon Jun 04, 2012 5:21 am    Post subject: How to remove the first matching string using esql Reply with quote

Centurion

Joined: 01 Aug 2010
Posts: 101

Hi,

Please anyone suggest how to replace the first matching values.

For example : Input as

Produce a char which is available to use instead char function.

Output as

Produce a set which is available to use instead char function.

I want to replace the first matching 'char' with 'set'. If i use replace function like below its replacing all the matching values.

Replace(InputRef,'char','set')

Is there any function available in esql to achieve this.

Please help on this.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Jun 04, 2012 5:30 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You should know this. Unless you slept through the WM663 class.

Use SELECT.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Jun 04, 2012 7:03 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

All of the functions that ESQL has are listed in the Info Center documentation.

Rather than asking "is there a function in ESQL", you should go answer this question by looking at the info center.
Back to top
View user's profile Send private message
vijayakumar
PostPosted: Tue Jun 05, 2012 11:04 am    Post subject: Reply with quote

Centurion

Joined: 01 Aug 2010
Posts: 101

I did nt found any relevant esql string functions.

Please help me.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Jun 05, 2012 11:11 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

vijayakumar wrote:
I did nt found any relevant esql string functions. Please help me.


Did you find the InfoCentre page for SELECT statement ?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Nikswe
PostPosted: Tue Jun 05, 2012 11:30 am    Post subject: Reply with quote

Newbie

Joined: 28 May 2012
Posts: 9
Location: Stockholm

You could try use position function together with some other string manipulation.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jun 05, 2012 11:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

SUBSTRING with BEFORE
SUBSTRING with AFTER
||

Back to top
View user's profile Send private message
rekarm01
PostPosted: Tue Jun 05, 2012 2:04 pm    Post subject: Re: How to remove the first matching string using esql Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

mqjeff wrote:
SUBSTRING with BEFORE
SUBSTRING with AFTER
||

Yes, that would work. Another option is to use OVERLAY+POSITION.

lancelotlinc wrote:
Use SELECT.

No, that won't work.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jun 06, 2012 6:10 am    Post subject: Re: How to remove the first matching string using esql Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

rekarm01 wrote:
lancelotlinc wrote:
Use SELECT.

No, that won't work.


It could work, along with corresponding other functions.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
vijayakumar
PostPosted: Wed Jun 06, 2012 9:21 am    Post subject: Reply with quote

Centurion

Joined: 01 Aug 2010
Posts: 101

Thanks all for your help.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 06, 2012 9:27 am    Post subject: Re: How to remove the first matching string using esql Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
rekarm01 wrote:
lancelotlinc wrote:
Use SELECT.

No, that won't work.


It could work, along with corresponding other functions.


Code snippet?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Wed Jun 06, 2012 4:26 pm    Post subject: Re: How to remove the first matching string using esql Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

lancelotlinc wrote:
It could work, along with corresponding other functions.

The question was about how to manipulate a string. SELECT does not manipulate strings.

To quote someone else: "You should know this. Unless you slept through the WM663 class."
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Jun 07, 2012 5:02 am    Post subject: Re: How to remove the first matching string using esql Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

rekarm01 wrote:
lancelotlinc wrote:
It could work, along with corresponding other functions.

The question was about how to manipulate a string. SELECT does not manipulate strings.

To quote someone else: "You should know this. Unless you slept through the WM663 class."


Very funny. A philosopher. I like you rekarm (don't care what Vitor said about you: age before beauty I always say) That quote rings a bell... (I won't publicly admit to dozing in the class; although, my team leader knows I do my best coding in my sleep.)
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu Jun 07, 2012 7:14 am    Post subject: Re: How to remove the first matching string using esql Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
don't care what Vitor said about you: age before beauty I always say


I resent the implication I insult people behind their backs. As both you, exerk and a number of others can testify I do it do their faces.

I'd also like to deny any ex forume conversations between us. While these do occur, you were not parte to any of them.

If you'd been excluded twice, it would have been a parte parte. When it had finished it would have been an ex parte parte.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to remove the first matching string using esql
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.