| Author | 
		  Message
		 | 
		
		  | mrch1 | 
		  
		    
			  
				 Posted: Sun Nov 29, 2009 6:55 pm    Post subject: How to Convert ROW to CHARACTER? | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 29 Nov 2009 Posts: 5
  
  | 
		  
		    
			  
				  hi,I'm currently using WMB 6.1.0.4 and i have an issue like this:
 
There is a ROW struct for example:
 
<row>
 
  <col>111</col>
 
  <col>222</col>
 
  <col>333</col>
 
</row>
 
My question is How can i convert it to CHARACTER like below?
 
<row><col>111</col><col>222</col><col>333</col></row>
 
THX! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | AkankshA | 
		  
		    
			  
				 Posted: Sun Nov 29, 2009 8:57 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 12 Jan 2006 Posts: 1494 Location: Singapore 
  | 
		  
		    
			  
				what ways have you tried so far ?? _________________ Cheers | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mrch1 | 
		  
		    
			  
				 Posted: Sun Nov 29, 2009 10:28 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 29 Nov 2009 Posts: 5
  
  | 
		  
		    
			  
				Currently i've tried using CAST(ROW AS CHARACTER),but it doesn't work;
 
I searched the manual and i found the CAST function doesn't support the ROW type.
 
I just tried using ASBITSTREAM to convert a XML tree to BLOB,and then output the BLOB to a file,i found the file content is just what i want,
 
NOW my question is how to convert BLOB to CHARACTER?   | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Sun Nov 29, 2009 11:12 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| mrch1 wrote: | 
   
  
	NOW my question is how to convert BLOB to CHARACTER?   | 
   
 
 
Have you tried CAST on that one? What were the effects?
 
And remember that unless you are using a CDATA section xml tags will be escaped...   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Mandeep | 
		  
		    
			  
				 Posted: Mon Nov 30, 2009 1:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 03 May 2004 Posts: 33
  
  | 
		  
		    
			  
				If you have BLOB available in Output root then u can use:
 
 
CAST(BITSTREAM(OutputRoot.BLOB) AS CHAR CCSID 1208 )
 
OR 
 
CAST(BITSTREAM(OutputRoot.BLOB.BLOB) AS CHAR CCSID 1208 ) | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | student | 
		  
		    
			  
				 Posted: Mon Nov 30, 2009 2:33 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 17 Mar 2009 Posts: 31 Location: UK 
  | 
		  
		    
			  
				| You could also specify encoding, format etc  while converting blob to char. See Cast function for details. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rekarm01 | 
		  
		    
			  
				 Posted: Mon Nov 30, 2009 11:18 am    Post subject: Re: How to Convert ROW to CHARACTER? | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 1415
  
  | 
		  
		    
			  
				
   
	| student wrote: | 
   
  
	| You could also specify encoding, format etc  while converting blob to char. See Cast function for details. | 
   
 
 
The CAST function does not use the ENCODING and FORMAT parameters when casting BLOB as CHARACTER. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | agrawalamit166 | 
		  
		    
			  
				 Posted: Mon Nov 30, 2009 1:31 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Voyager
 
 Joined: 17 Aug 2009 Posts: 78 Location: NY, US 
  | 
		  
		    
			  
				| it's always better to use InputProperties.CodedCharSetId inplace of 1208.. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rekarm01 | 
		  
		    
			  
				 Posted: Mon Nov 30, 2009 1:49 pm    Post subject: Re: How to Convert ROW to CHARACTER? | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 1415
  
  | 
		  
		    
			  
				
   
	| agrawalamit166 wrote: | 
   
  
	| it's always better to use InputProperties.CodedCharSetId in place of 1208.. | 
   
 
 
Not always.  It's appropriate for InputRoot.BLOB.BLOB, but not necessarily for other BLOBs.
 
 
It is always better though, to use ASBITSTREAM in place of BITSTREAM, as the latter is deprecated. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mrch1 | 
		  
		    
			  
				 Posted: Tue Dec 01, 2009 1:12 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 29 Nov 2009 Posts: 5
  
  | 
		  
		    
			  
				thanks for all replies!
 
It seems that there's no way that convert ROW type to CHARACTER directly.I've solved the problem indirectly.here is the way:
 
1.convert the ROW type to BLOB using ASBITSTREAM.
 
2.convert BLOB to CHARACTER using CAST. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |