| Author | 
		  Message
		 | 
		
		  | bond_02 | 
		  
		    
			  
				 Posted: Mon Dec 25, 2006 4:45 am    Post subject: Write ESQL code to extract data from the DB and merge it | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 21 Dec 2006 Posts: 39 Location: kolkata 
  | 
		  
		    
			  
				Hi,
 
 
Suppose you have the following XML message in one column of the database:
 
 
<test><data>data from database</data></test>
 
 
 
 
 
Now I give the following input:
 
 
<test><data>data from input</data></test>
 
 
 
 
 
Write ESQL code to extract data from the DB and merge it with the input so that I get the following output:
 
 
<test><data>data from input</data></test><test><data>data from database</data></test> | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Bill.Matthews | 
		  
		    
			  
				 Posted: Mon Dec 25, 2006 9:07 am    Post subject: Re: Write ESQL code to extract data from the DB and merge it | 
				     | 
			   
			 
		   | 
		
		
		    Master
 
 Joined: 23 Sep 2003 Posts: 232 Location: IBM (Retired) 
  | 
		  
		    
			  
				
   
	| bond_02 wrote: | 
   
  
	Hi,
 
 
Suppose you have the following XML message in one column of the database:
 
 
<test><data>data from database</data></test>
 
 
 
 
 
Now I give the following input:
 
 
<test><data>data from input</data></test>
 
 
 
 
 
Write ESQL code to extract data from the DB and merge it with the input so that I get the following output:
 
 
<test><data>data from input</data></test><test><data>data from database</data></test> | 
   
 
 
 
But that result is invalid XML! _________________ Bill Matthews | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bond_02 | 
		  
		    
			  
				 Posted: Mon Dec 25, 2006 8:27 pm    Post subject: Re: Write ESQL code to extract data from the DB and merge it | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 21 Dec 2006 Posts: 39 Location: kolkata 
  | 
		  
		    
			  
				But that result is invalid XML![/quote].----
 
sir,
 
i did not want the out put as XML!it may be blob! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | AkankshA | 
		  
		    
			  
				 Posted: Mon Dec 25, 2006 9:19 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 12 Jan 2006 Posts: 1494 Location: Singapore 
  | 
		  
		    
			  
				Sorry but i dint get your query,,,,,
 
 
How are you extracting the value from the database...
 
 
is there any reasoning for not using concatinate "||"  operation | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bond_02 | 
		  
		    
			  
				 Posted: Mon Dec 25, 2006 10:34 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 21 Dec 2006 Posts: 39 Location: kolkata 
  | 
		  
		    
			  
				
   
	| Akanksha wrote: | 
   
  
	Sorry but i dint get your query,,,,,
 
 
How are you extracting the value from the database...
 
 
is there any reasoning for not using concatinate "||"  operation | 
   
 
 
 
 
you can but No tags are to be generated by the code that shuld be generic for any input xml . Merging should be tag independent. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Adi3 | 
		  
		    
			  
				 Posted: Tue Dec 26, 2006 7:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 19 Dec 2006 Posts: 15
  
  | 
		  
		    
			  
				<test><data>data from input</data></test><test><data>data from database</data></test> 
 
 
 
 
 
The expecting result is an invalid XML.
 
Root tag <test> cannot be more than one.
 
 
You can form the resultant XML like this If you wish to have both input and db data in the resultant XML:
 
 
<Result><test><data>data from input</data></test><test><data>data from database</data></test></Result> | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Tue Dec 26, 2006 7:31 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				This is either an extremely basic use of the product - and you are asking someone else to write the code for you - or it is an extremely complicated question that you have very poorly asked.
 
 
Either way, what have *you* tried, what are the results *you* are getting? _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bond_02 | 
		  
		    
			  
				 Posted: Tue Dec 26, 2006 9:16 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 21 Dec 2006 Posts: 39 Location: kolkata 
  | 
		  
		    
			  
				
   
	| Adi3 wrote: | 
   
  
	<test><data>data from input</data></test><test><data>data from database</data></test> 
 
 
 
 
 
The expecting result is an invalid XML.
 
Root tag <test> cannot be more than one.
 
 
You can form the resultant XML like this If you wish to have both input and db data in the resultant XML:
 
 
<Result><test><data>data from input</data></test><test><data>data from database</data></test></Result> | 
   
 
 
 
 
nope! friend.there shuld be no super tag and output is not mandatory to be XML may be blob. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bond_02 | 
		  
		    
			  
				 Posted: Tue Dec 26, 2006 10:07 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 21 Dec 2006 Posts: 39 Location: kolkata 
  | 
		  
		    
			  
				| WHY 'CREATE' LASTCHILD IS FASTER THAN 'SET' STATEMENT WHEN ASSIGNING VALUE TO OUTPUT XML MESSAGE! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bond_02 | 
		  
		    
			  
				 Posted: Tue Dec 26, 2006 10:09 pm    Post subject: WHY 'CREATE' LASTCHILD IS FASTER THAN 'SET' STATEMENT | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 21 Dec 2006 Posts: 39 Location: kolkata 
  | 
		  
		    
			  
				| WHY 'CREATE' LASTCHILD IS FASTER THAN 'SET' STATEMENT WHEN ASSIGNING VALUE TO OUTPUT XML MESSAGE! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Wed Dec 27, 2006 4:19 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| bond_02 wrote: | 
   
  
	
   
	| Adi3 wrote: | 
   
  
	<test><data>data from input</data></test><test><data>data from database</data></test> 
 
 
 
 
 
The expecting result is an invalid XML.
 
Root tag <test> cannot be more than one.
 
 
You can form the resultant XML like this If you wish to have both input and db data in the resultant XML:
 
 
<Result><test><data>data from input</data></test><test><data>data from database</data></test></Result> | 
   
 
 
 
 
nope! friend.there shuld be no super tag and output is not mandatory to be XML may be blob. | 
   
 
So do you mean to say that the output is a partial xml i.e. to be inserted somewhere in a global tag?
 
 
Whichever way the output can only be valid XML.
 
 
So you either have to create a single parent tag or not get the output you want ....ever... not even as a BLOB(because you would have to serialize as a folder...)
 
 
Enjoy    _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |