| Author | 
		  Message
		 | 
		
		  | Paul Huang | 
		  
		    
			  
				 Posted: Mon Dec 30, 2002 9:07 pm    Post subject: XML message failed when selected a null field from DB | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 04 Jun 2002 Posts: 8 Location: Taiwan 
  | 
		  
		    
			  
				hi,
 
 
If a field of a DB table is presented as null value. When a XML message tree
 
field assigned to the field of the table, the message tree will fail. Is there any
 
technique to bypass the problem? thanks | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Mon Dec 30, 2002 9:41 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				Could you please explain this ...
 
   
	| Paul Huang wrote: | 
   
  
	
 
..message tree will fail.
 
 | 
   
 
 _________________ 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Paul Huang | 
		  
		    
			  
				 Posted: Mon Dec 30, 2002 10:25 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 04 Jun 2002 Posts: 8 Location: Taiwan 
  | 
		  
		    
			  
				hi kirani,
 
 
Sorry for not making this clear. The message will failed means that 
 
the particular field is dropped off due to assignment to a null value and 
 
considered incomplete message in later message flow processes. 
 
Is there way to prevent the field dropping while selected a null
 
value from database? thanks! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jbacskai | 
		  
		    
			  
				 Posted: Fri Jan 03, 2003 2:35 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 30 Dec 2002 Posts: 26 Location: Hungary 
  | 
		  
		    
			  
				Hi,
 
 
In MSSQL you can use the isnull() function in the SQL string to solve this problem, and I suggest that in DB2 and in ORACLE there is something like this.
 
 
I hope I could help. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wmqiguy | 
		  
		    
			  
				 Posted: Fri Jan 03, 2003 5:22 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 09 Oct 2002 Posts: 145 Location: Florida 
  | 
		  
		    
			  
				Might try something like this:
 
 
DELCARE X;
 
 
SET X = SELECT * FROM blah, blah;
 
 
IF X IS NULL or X = '' THEN
 
   SET OutputRoot.XML.a.b.c = "DEFAULT VALUE";
 
ELSE
 
   SET OutputRoot.XML.a.b.c = X;
 
END IF;
 
 
Just pseudocode.  Might need some manipulation on your part, depending on your requirements.
 
 
Good Luck!        
 
 
Todd | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |