| Author | 
		  Message
		 | 
		
		  | amitk22784 | 
		  
		    
			  
				 Posted: Thu Feb 23, 2012 6:46 am    Post subject: E-sql Trim function issue | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 23 Nov 2009 Posts: 9
  
  | 
		  
		    
			  
				Hi All
 
 
E-sql trim function is not working as I want to remove the space from string.
 
I have tried both the syntax trim(string_name)  & TRIM(TRAILING ' ' FROM string_name) 
 
but output is not comming properly.
 
 
 
Please reply asap | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Thu Feb 23, 2012 6:47 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Thu Feb 23, 2012 6:48 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				| please confirm the definition of "output is not comming properly". | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | adubya | 
		  
		    
			  
				 Posted: Thu Feb 23, 2012 7:17 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Partisan
 
 Joined: 25 Aug 2011 Posts: 377 Location: GU12, UK 
  | 
		  
		    
			  
				| You need to assign the result of the TRIM to a variable using SET, TRIM doesn't alter the input data. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | amitk22784 | 
		  
		    
			  
				 Posted: Thu Feb 23, 2012 9:45 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 23 Nov 2009 Posts: 9
  
  | 
		  
		    
			  
				| Actually I have assigned the value to new variable but spaces is not getting removed from the string. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Thu Feb 23, 2012 9:52 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| amitk22784 wrote: | 
   
  
	| Actually I have assigned the value to new variable but spaces is not getting removed from the string. | 
   
 
 
 
If you're working on "JOHN SMITH   " and are getting "JOHN SMITH" then that's working as designed because TRIM doesn't remove embedded spaces. In any language not just ESQL.
 
 
If you're getting "JOHN SMITH  " then you either have a code bug or reason for a PMR.
 
 
If you're gettting "BOOK TRAINING" then you've got the new knowledge level detector feature enabled. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Esa | 
		  
		    
			  
				 Posted: Fri Feb 24, 2012 1:19 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 22 May 2008 Posts: 1387 Location: Finland 
  | 
		  
		    
			  
				
   
	| Vitor wrote: | 
   
  
	
 
If you're gettting "BOOK TRAINING" then you've got the new knowledge level detector feature enabled. | 
   
 
 
 
The knowledge level detector feature enabled on mqseries.net gives you "contact admin"    | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |