Home » SQL & PL/SQL » SQL & PL/SQL » XML Variables (10g r2)
XML Variables [message #600066] Thu, 31 October 2013 09:16 Go to next message
leeweb
Messages: 14
Registered: March 2007
Location: Cardiff, UK
Junior Member
Hi all,

I have an interesting problem that I hoped you might be able to help with. I have some XML being returned from a web service, and it returns almost 900 variables. Whilst I am familiar with how to return these in a single row, does anybody know if I can return a row for each variable? My DBA is very uncomfortable with creating a table with almost 900 columns, for obvious reasons. However, we already have plenty of tables with tens of millions of rows, so he's fine with that. I'll try and expand on the requirement. Below is some XML from the data returned to us:

<APPLICANT app_no="1">
  <APPLSUMMARY>
    <MAIN W="ZZ" X="{ND}"/>
    <COUNTS Z="3" AB="0" BB="3" CB="0" DB="3" EB="3" FB="3" GB="0"/>
  </APPLSUMMARY>
</APPLICANT>


I would like to be able to return a new row for each variable, For example:

VARIABLE | VALUE
----------------
W        | ZZ
X        | {ND}
Z        | 3
And so on...


Any help would be much appreciated,

Thanks,

Lee
Re: XML Variables [message #600067 is a reply to message #600066] Thu, 31 October 2013 09:33 Go to previous messageGo to next message
leeweb
Messages: 14
Registered: March 2007
Location: Cardiff, UK
Junior Member
Sorry, they're not called variables are they. I meant attributes
Re: XML Variables [message #600073 is a reply to message #600067] Thu, 31 October 2013 10:32 Go to previous message
Solomon Yakobson
Messages: 3273
Registered: January 2010
Location: Connecticut, USA
Senior Member
Use XMLTABLE.

SY.
Previous Topic: Pivot query: grouping pivot field, using query for IN clause
Next Topic: PL/SQL
Goto Forum:
  


Current Time: Tue Apr 23 21:33:49 CDT 2024