Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to extract source name from XML

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to extract source name from XML
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Aug 31, 2015 3:55 pm    Post subject: Reply to: How to extract source name from XML
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    Post subject: Reply to: How to extract source name from XML
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Spool Extract for Z /os 1.04 version Khadhar Basha CLIST & REXX 3 Thu Sep 28, 2017 3:14 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Extract Data till prev hour balaji81_k DB2 16 Fri Aug 25, 2017 9:25 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us