Author |
Message
|
vijayakumar |
Posted: Mon Jun 04, 2012 5:21 am Post subject: How to remove the first matching string using esql |
|
|
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 |
|
 |
lancelotlinc |
Posted: Mon Jun 04, 2012 5:30 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jun 04, 2012 7:03 am Post subject: |
|
|
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 |
|
 |
vijayakumar |
Posted: Tue Jun 05, 2012 11:04 am Post subject: |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
I did nt found any relevant esql string functions.
Please help me. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Jun 05, 2012 11:11 am Post subject: |
|
|
 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 |
|
 |
Nikswe |
Posted: Tue Jun 05, 2012 11:30 am Post subject: |
|
|
Newbie
Joined: 28 May 2012 Posts: 9 Location: Stockholm
|
You could try use position function together with some other string manipulation. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 05, 2012 11:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
SUBSTRING with BEFORE
SUBSTRING with AFTER
||
 |
|
Back to top |
|
 |
rekarm01 |
Posted: Tue Jun 05, 2012 2:04 pm Post subject: Re: How to remove the first matching string using esql |
|
|
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 |
|
 |
lancelotlinc |
Posted: Wed Jun 06, 2012 6:10 am Post subject: Re: How to remove the first matching string using esql |
|
|
 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 |
|
 |
vijayakumar |
Posted: Wed Jun 06, 2012 9:21 am Post subject: |
|
|
Centurion
Joined: 01 Aug 2010 Posts: 101
|
Thanks all for your help. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 06, 2012 9:27 am Post subject: Re: How to remove the first matching string using esql |
|
|
 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 |
|
 |
rekarm01 |
Posted: Wed Jun 06, 2012 4:26 pm Post subject: Re: How to remove the first matching string using esql |
|
|
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 |
|
 |
lancelotlinc |
Posted: Thu Jun 07, 2012 5:02 am Post subject: Re: How to remove the first matching string using esql |
|
|
 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 |
|
 |
Vitor |
Posted: Thu Jun 07, 2012 7:14 am Post subject: Re: How to remove the first matching string using esql |
|
|
 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 |
|
 |
|