| Author | 
		  Message
		 | 
		
		  | oli | 
		  
		    
			  
				 Posted: Thu Oct 11, 2012 1:59 am    Post subject: Using CHAR with REFERENCE TO | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 14 Jul 2006 Posts: 68 Location: Germany 
  | 
		  
		    
			  
				Hi all,
 
 
I currently have the same problem as described in http://www.mqseries.net/phpBB/viewtopic.php?p=304027
 
 
I have a CHAR variable myVar that is to be used as a field reference, e.g. "InputLocalEnvironment.Variables.config".
 
 
I now want to use the variable myVar to achieve the same as with
 
   
	| Code: | 
   
  
	| DECLARE myRef REFERENCE TO InputLocalEnvironment.Variables.config; | 
   
 
 
 
Unfortunately the method described in the above mentioned topic to use EVAL doesn't work in the way described. When I use
 
   
	| Code: | 
   
  
	| DECLARE myRef REFERENCE TO EVAL(myVar); | 
   
 
 
the ESQL editor shows an error
 
   
	| Code: | 
   
  
	| Syntax error. Valid options include: ; | 
   
 
 
 
What is wrong here? Do I miss anything?
 
 
Thanks Oli | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kimbert | 
		  
		    
			  
				 Posted: Thu Oct 11, 2012 2:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 Location: Southampton 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Thu Oct 11, 2012 3:07 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				the eval was apparently my earlier suggestion.
 
 
I'm going to have to disagree with myself, and suggest you follow kimbert's method instead. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Thu Oct 11, 2012 3:33 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				And remember the {} syntax is only valid for 1 level... so you may have
 
InputBody.{}.{}.{}...   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Thu Oct 11, 2012 3:35 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| fjb_saper wrote: | 
   
  
	And remember the {} syntax is only valid for 1 level... so you may have
 
InputBody.{}.{}.{}...   | 
   
 
 
 
Anyways why not use MOVE ref TO ref.FirstChild, nextSibling etc... and check the FieldName(ref) and FieldNamespace(ref) ?   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |