Page 1 of 1

Querying XML tag from DB2 table

PostPosted: Tue Jan 24, 2012 7:22 pm
by Mann_B
Hi every one,
I am trying to retrieve a tag data from an xml which is stored in DB2 table in raw xml format. I tried in 2 ways.

1) using string search in query and search entire xml, but its making DB2 query to consume more and I cannot use this as i have to retrieve around 80 strings like this.

2) Using XML CAST and XMl query key words.
XMLCAST (
XMLQUERY ('//AAAAAA/bbbbb/tagdata'
PASSING XML_DATA)
AS VARCHAR(11) )
FROM XYZ

above query executing successful but not retrieving tag data.
Could you please help on this.

Re: Querying XML tag from DB2 table

PostPosted: Mon Jan 30, 2012 3:22 pm
by Mann_B
Hi every one,

Can some one tell me how to extract the node data from XML. which is stored in DB2 table in complete XML format.

Re: Querying XML tag from DB2 table

PostPosted: Mon Jan 30, 2012 3:36 pm
by enrico-sorichetti
soliciting for answers is not likely to get more

just remember ... replying on a forum is
voluntary base
on our own time
interest of the topic

if You do not get any answers...
the topic might not be interesting,
nobody might care ( know the answer )

remember also the most of the replies are based on experience,
not everybody is willing to spend time investigating somebody else problems

Re: Querying XML tag from DB2 table

PostPosted: Mon Jan 30, 2012 3:45 pm
by BillyBoyo
enrico is correct. I came across an article the other day about XML and DB2. I wasn't specifically looking for that, so didn't take any notice of it. This was whilst googling for something else. Have you tried google?

Re: Querying XML tag from DB2 table

PostPosted: Mon Jan 30, 2012 4:19 pm
by Mann_B
Hi ,
I am trying in google to get information on this,even im browsing IBM website and got some keywords to retrieve data from DB2 tables like extractVarchar, Xquery,extract retrieved_datatype and many more.. I keep on trying these keywords.

As im a beginner, I kept this question here to get some good ideas from experts.

Re: Querying XML tag from DB2 table

PostPosted: Mon Jan 30, 2012 4:36 pm
by BillyBoyo
Trouble is, if people reading this don't have experience of doing that, then unless we do all the research to find it out (unlikely) then we can't help. Although this site is for beginners, we can't cover all areas of mainframe use just because there is a beginner in that area.

Maybe for this question you need to find a more db2-related forrum, or see if there is an xml-mainframe forum. What about your coworkers? Support at your site? They'd always be my starting point. If they have nothing, why have they left you, as a beginner, doing this?

Re: Querying XML tag from DB2 table

PostPosted: Tue Feb 14, 2012 7:19 pm
by Mann_B
Hi All,
At last.. I got answers to my question...Now I am able to retrieve the XML nodes and data.. at any level,... :)

you can find gud pdf on this at below link
http://www.redbooks.ibm.com/abstracts/sg247315.html