Re: How to get Attributes in XML Output

From: Frank <fvanbortel_at_netscape.net>
Date: Tue, 15 Apr 2003 20:17:48 +0200
Message-ID: <3E9C4CCC.3030705_at_netscape.net>


Ryan wrote:
> 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>
> <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>
>
> 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" 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

Dig into XSQL - will use standard sql and create the output as you wish. XSQL comes with the HTTP server - database or 9iAS doesn't matter

-- 
Regards, Frank van Bortel
Received on Tue Apr 15 2003 - 20:17:48 CEST

Original text of this message