IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to extract source name from XML


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ANIRUDH A

New User


Joined: 31 Aug 2015
Posts: 4
Location: india

PostPosted: Mon Aug 31, 2015 3:34 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 31, 2015 3:55 pm
Reply with quote

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
View user's profile Send private message
ANIRUDH A

New User


Joined: 31 Aug 2015
Posts: 4
Location: india

PostPosted: Mon Aug 31, 2015 4:23 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts optim extract file - SAS DB2 2
No new posts How to extract the data for current y... DFSORT/ICETOOL 8
No new posts Extract record using 2 input file int... JCL & VSAM 2
Search our Forums:

Back to Top