How to get Attributes in XML Output
Date: 14 Apr 2003 18:20:55 -0700
Message-ID: <bbfe1f32.0304141418.7438458f_at_posting.google.com>
I've seen plenty of examples that show how to query tables and get
results such as the following, where the data is shown in elements:
<ROWSET>
My question is, how do I get the data in attributes? Is it even
possible? I'm familiar with using FOR XML in MS SQL, but have not
come across a similar procedure in Oracle 9i. An example of the
output using the above example would be:
<ROWSET>
<ROW num="1">
<CUSTOMER>
<CUSTOMERID>1044</CUSTOMERID>
<FIRSTNAME>Paul</FIRSTNAME>
<LASTNAME>Astoria</LASTNAME>
<HOMEADDRESS>
<STREET>123 Cherry Lane</STREET>
<CITY>SF</CITY>
<STATE>CA</STATE>
<ZIP>94132</ZIP>
</HOMEADDRESS>
</CUSTOMER>
</ROW>
</ROWSET>
<ROW num="1">
<CUSTOMER CUSTOMERID="1044" FIRSTNAME="Paul" LASTNAME="Astoria">
<HOMEADDRESS STREET="123 Cherry Lane" CITY="SF" STATE="CA"
ZIP="94132">
</HOMEADDRESS>
</CUSTOMER>
</ROW>
</ROWSET>
I hope that makes sense. Thanks.
Ryan Received on Tue Apr 15 2003 - 03:20:55 CEST