Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

node name in oracle xml

Status
Not open for further replies.

rania1483

Programmer
Dec 22, 2005
1
US
hello, i have an xml file stored in my database and i want to use sqls to access the nodes in the file. i need a sql that would give me the name of the children nodes given the parent, i found the following sql:

SELECT VALUE(P).GETCLOBVAL()
FROM "ODB"."TRAXDOC_DETAIL" w,
TABLE(XMLSEQUENCE(EXTRACT("XML_DOCUMENT", '/AMM/*'))) P
WHERE w."TRAXDOC_NO"= 11 and w."TRAXDOC_LINE" = 1 ;

this sql gives the contents of the children of amm, however i only want the name of the nodes not the actual xml text. is there anyway to rewrite the path to get only the name of the children nodes?
 
The path is correct, it returns the node list, not the values. I have never used or seen oracle xml stuff, but I'm guessing you need to change this:

SELECT VALUE(P).GETCLOBVAL()

Perhaps to something like (a guess):

SELECT NAME(P).GETCLOBVAL()

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top