| Author | 
		  Message
		 | 
		
		  | vmurdesh | 
		  
		    
			  
				 Posted: Tue Aug 06, 2002 11:09 am    Post subject: Converting String to BLOB in ESQL | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 09 May 2002 Posts: 18
  
  | 
		  
		    
			  
				I am trying to convert a string in the Environment tree to a BLOB (without resorting to Hex)
 
 
DECLARE myMessage BLOB;
 
SET myMessage = X'45415F454E' || BITSTREAM(Environment.Variables.ServiceName); 
 
 
This syntax does not work (and neither does CAST).
 
 
Is there another way?
 
 
Thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Tue Aug 06, 2002 11:35 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				What kind of error are you getting? Is it a
 
1. Syntax error in Control Center
 
2. Error during deploy of the message flow
 
3. runtime error? 
 
 
could you post your ExceptionList here? _________________ Kiran
 
 
 
IBM Cert. Solution Designer & System Administrator - WBIMB V5
 
IBM Cert. Solutions Expert - WMQI
 
IBM Cert. Specialist - WMQI, MQSeries
 
IBM Cert. Developer - MQSeries
 
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vmurdesh | 
		  
		    
			  
				 Posted: Tue Aug 06, 2002 1:55 pm    Post subject: No deployment or runtime error.. | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 09 May 2002 Posts: 18
  
  | 
		  
		    
			  
				The String value in Environment.Variables.ServiceName is just not a part of the myMessage BLOB.
 
thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Tue Aug 06, 2002 2:32 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				This is strange ... but I think BITSTREAM function does not work on local variables, Environment and LocalEnvironment trees. It only works on incoming message or the message constructed in the Compute node. 
 
 
Any idea??    _________________ Kiran
 
 
 
IBM Cert. Solution Designer & System Administrator - WBIMB V5
 
IBM Cert. Solutions Expert - WMQI
 
IBM Cert. Specialist - WMQI, MQSeries
 
IBM Cert. Developer - MQSeries
 
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Tibor | 
		  
		    
			  
				 Posted: Wed Aug 07, 2002 12:31 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 20 May 2001 Posts: 1033 Location: Hungary 
  | 
		  
		    
			  
				
   
	| kirani wrote: | 
   
  
	This is strange ... but I think BITSTREAM function does not work on local variables, Environment and LocalEnvironment trees. It only works on incoming message or the message constructed in the Compute node. 
 
 
Any idea??    | 
   
 
 
BITSTREAM won't work in this case because the broker doesn't know about physical layer (XML, CWF, etc).
 
 
In contrast: Root.Properties contains this information but Environment hasn't got any similar. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Miriam Kaestner | 
		  
		    
			  
				 Posted: Wed Aug 07, 2002 4:19 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 26 Jun 2001 Posts: 103 Location: IBM IT Education Services, Germany 
  | 
		  
		    
			  
				CAST should work:
 
SET myMessage = X'45415F454E' || CAST(Environment.Variables.ServiceName AS BLOB CCSID OutputRoot.MQMD.CodedCharSetId); | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vmurdesh | 
		  
		    
			  
				 Posted: Wed Aug 07, 2002 8:20 am    Post subject: CAST and BITSTREAM both do not work.. | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 09 May 2002 Posts: 18
  
  | 
		  
		    
			  
				A CAST does not work.. Gives this in the NT Event Log.
 
 
An attempt was made to cast the character string 'JacadaFNOL' to a byte string, but the string was of the wrong format.  There must be an even number of hexadecimal digits (0-9, a-f, A-F).   
 
 
The BITSTREAM i think can only be used on the Root Tree. (produces no error but just does not append the variable to the message..)
 
BITSTREAM(Environment.Variables.ServiceName); 
 
 
Thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Wed Aug 07, 2002 9:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				CAST with CCSID will work in WMQI 2.1 CSD2.
 
What version of MQSI/WMQI are you using and what CSD level? _________________ Kiran
 
 
 
IBM Cert. Solution Designer & System Administrator - WBIMB V5
 
IBM Cert. Solutions Expert - WMQI
 
IBM Cert. Specialist - WMQI, MQSeries
 
IBM Cert. Developer - MQSeries
 
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vmurdesh | 
		  
		    
			  
				 Posted: Wed Aug 07, 2002 9:44 am    Post subject: Cool.. With CCSID does work !!! | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 09 May 2002 Posts: 18
  
  | 
		  
		    
			  
				I had thought CCSID is only across platforms.
 
THANKS!!!! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |