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 » Trimming "tab" character in ESQL

Post new topic  Reply to topic
 Trimming "tab" character in ESQL « View previous topic :: View next topic » 
Author Message
dan2WMB
PostPosted: Mon Dec 06, 2010 5:28 am    Post subject: Trimming "tab" character in ESQL Reply with quote

Novice

Joined: 06 Aug 2010
Posts: 12

I am trying to use ESQL TRIM() function to trim white spaces in a string.It is working for trimming leading and trailing white spaces, but not for "tab" character. How to trim a string containing "tab" character in its leading/trailing end?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 06, 2010 5:30 am    Post subject: Re: Trimming "tab" character in ESQL Reply with quote

Grand High Poobah

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

dan2WMB wrote:
How to trim a string containing "tab" character in its leading/trailing end?


SUBSTRING & TRANSLATE are always popular choices for this kind of task.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
dan2WMB
PostPosted: Mon Dec 06, 2010 6:07 am    Post subject: Reply with quote

Novice

Joined: 06 Aug 2010
Posts: 12

Thanks for your reply, Vitor.

Could you please tell me how to find a "tab" character in a string? we can use POSITION() function for this.But how to specify the "tab" character in the search parameter? Do we need to mention ASCII value of "tab" character in that function?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 06, 2010 6:14 am    Post subject: Reply with quote

Grand High Poobah

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

dan2WMB wrote:
we can use POSITION() function for this.But how to specify the "tab" character in the search parameter?


POSITION is an unnecessary step. Use SUBSTRING AFTER.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
dan2WMB
PostPosted: Mon Dec 06, 2010 6:24 am    Post subject: Reply with quote

Novice

Joined: 06 Aug 2010
Posts: 12

Do we have SUBSTRING AFTER function in ESQL? I thought we have only SUBSTRING function. How to find a "tab" character in a string?
Back to top
View user's profile Send private message
dan2WMB
PostPosted: Mon Dec 06, 2010 6:27 am    Post subject: Reply with quote

Novice

Joined: 06 Aug 2010
Posts: 12

Sorry. i found how to use SUBSTRING AFTER. Please help me to find a "tab" character in a string.
Back to top
View user's profile Send private message
mgk
PostPosted: Mon Dec 06, 2010 7:05 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Try:

Code:
DECLARE tab CAST(X'09' AS CHARACTER CCSID 1208);
DECLARE result CHARACTER TRIM( tab FROM myInputString );
Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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 » Trimming "tab" character in 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.