View previous topic :: View next topic
|
Author |
Message |
ANIRUDH A
New User
Joined: 31 Aug 2015 Posts: 4 Location: india
|
|
|
|
Hi All,
I have an XML file stored in DB2 table.I want to extract the source name from the table. Can anyone explain me what is meant by source in xml and how to extract source name from XML.
Thanks in advance. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I'm sure that the XML processing in DB2 is documented. What is it about the documentation that doesn't answer your question? Is this some homework, or some challenge? |
|
Back to top |
|
|
ANIRUDH A
New User
Joined: 31 Aug 2015 Posts: 4 Location: india
|
|
|
|
Hi Bill,
I am new to XML. I want to extract root document name(source) from any XML.I used the code :
Code: |
select xmlcast(xmlquery('name(/*)' PASSING source_data ) as CHAR(30))
from table ; |
I read the manual and wrote this code but I did not get how to fetch the source name. Did not understand the exact usage of name function in xml.Does it by default gives the source name ? |
|
Back to top |
|
|
|