ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Write ESQL code to extract data from the DB and merge it

Post new topic  Reply to topic
 Write ESQL code to extract data from the DB and merge it « View previous topic :: View next topic » 
Author Message
bond_02
PostPosted: Mon Dec 25, 2006 4:45 am    Post subject: Write ESQL code to extract data from the DB and merge it Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Bill.Matthews
PostPosted: Mon Dec 25, 2006 9:07 am    Post subject: Re: Write ESQL code to extract data from the DB and merge it Reply with quote

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
View user's profile Send private message
bond_02
PostPosted: Mon Dec 25, 2006 8:27 pm    Post subject: Re: Write ESQL code to extract data from the DB and merge it Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
AkankshA
PostPosted: Mon Dec 25, 2006 9:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bond_02
PostPosted: Mon Dec 25, 2006 10:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Adi3
PostPosted: Tue Dec 26, 2006 7:04 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 26, 2006 7:31 am    Post subject: Reply with quote

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
View user's profile Send private message
bond_02
PostPosted: Tue Dec 26, 2006 9:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
bond_02
PostPosted: Tue Dec 26, 2006 10:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
bond_02
PostPosted: Tue Dec 26, 2006 10:09 pm    Post subject: WHY 'CREATE' LASTCHILD IS FASTER THAN 'SET' STATEMENT Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
fjb_saper
PostPosted: Wed Dec 27, 2006 4:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Write ESQL code to extract data from the DB and merge it
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.