| Author | 
		  Message
		 | 
		
		  | madi | 
		  
		    
			  
				 Posted: Fri Feb 24, 2006 7:58 am    Post subject: eSQL | 
				     | 
			   
			 
		   | 
		
		
		    Chevalier
 
 Joined: 17 Jan 2006 Posts: 475
  
  | 
		  
		    
			  
				Hi All
 
 
I am using the following code to do some transformation.
 
 
   
	| Code: | 
   
  
	WHILE I <= 100 DO
 
         SET cur = 'BAR_CODE_PRIMARY_FLAG_' || CAST(I as CHAR);
 
         SET text = 'BAR_CODE_NUMBER_' || CAST(I AS CHAR);
 
         IF ism."cur" = 'Y' THEN
 
            SET product.UPC = FIELDVALUE(ism."text");
 
            SET I = 101;
 
         ELSE SET I = I + 1;   END IF; 
 
      END WHILE; | 
   
 
 
in the IF statement when i say ism."cur", I want it to point ism.BAR_CODE_PRIMARY_FLAG_I. Is it doing that?? I also tried without the "".
 
 
I am not getting anything in the output message. If I am doing it wrong plz correct me.
 
 
ALso is there a way to BREAK out of the loop instead of setting I = 101!!
 
 
plz help
 
madi | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Fri Feb 24, 2006 8:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				No, you can't interpret text as message tree references that way.
 
 
There is an operator {} that will do that.
 
 
PLEASE read the documentation.
 
 
It will also tell you about loop structures, including how to break out of them. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JT | 
		  
		    
			  
				 Posted: Fri Feb 24, 2006 8:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Padawan
 
 Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT. 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| ALso is there a way to BREAK out of the loop instead of setting I = 101!!  | 
   
 
 
LEAVE | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | madi | 
		  
		    
			  
				 Posted: Fri Feb 24, 2006 8:11 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Chevalier
 
 Joined: 17 Jan 2006 Posts: 475
  
  | 
		  
		    
			  
				Thanks guys. 
 
 
The help in the broker has i think a really bad serach engine. I tried for like 1/2 hr to find this but couldnt. Part of the problem is also that I dont know what keywords to use for a particular thing.
 
 
--madi | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Fri Feb 24, 2006 8:17 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JT | 
		  
		    
			  
				 Posted: Fri Feb 24, 2006 8:26 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Padawan
 
 Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT. 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| the problem is also that I dont know what keywords to use for a particular thing. | 
   
 
 
I searched for 'while loop', and found the LEAVE statement. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |