Querying XML tag from DB2 table



IBM's flagship relational database management system

Querying XML tag from DB2 table

Postby Mann_B » Tue Jan 24, 2012 7:22 pm

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.
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: Querying XML tag from DB2 table

 

Re: Querying XML tag from DB2 table

Postby Mann_B » Mon Jan 30, 2012 3:22 pm

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.
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: Querying XML tag from DB2 table

Postby enrico-sorichetti » Mon Jan 30, 2012 3:36 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Querying XML tag from DB2 table

Postby BillyBoyo » Mon Jan 30, 2012 3:45 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Querying XML tag from DB2 table

Postby Mann_B » Mon Jan 30, 2012 4:19 pm

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.
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: Querying XML tag from DB2 table

Postby BillyBoyo » Mon Jan 30, 2012 4:36 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Querying XML tag from DB2 table

Postby Mann_B » Tue Feb 14, 2012 7:19 pm

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
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post