SYS_XMLGEN
420739May 29 2004 — edited May 29 2004Hi,
I've got an relational table called "CUSTOMER" with two columns (CustomerID, Name) and the following entries:
ID Name
111 Jones
222 Kent
333 Walker
Now I perform the following function:
SELECT SYS_XMLGEN(CustomerID).getStringVal()
FROM Customer
The result is:
<?xml version="1.0"?>
<KUNDENNR>234</KUNDENNR>
<?xml version="1.0"?>
<KUNDENNR>575</KUNDENNR>
<?xml version="1.0"?>
<KUNDENNR>781</KUNDENNR>
Now two questions:
1.) How can I achieve that the result is put into only one XML-document like this:
<?xml version="1.0"?>
<KUNDENNR>234</KUNDENNR>
<KUNDENNR>575</KUNDENNR>
<KUNDENNR>781</KUNDENNR>
2.) It is possible to get a XML-Document with SYS_XMLGEN like this:
<?xml version="1.0"?>
<KUNDENNR>234</KUNDENNR>
<NAME>Jones</NAME>
<KUNDENNR>575</KUNDENNR>
<NAME>Kent</NAME>
<KUNDENNR>781</KUNDENNR>
<NAME>Walker</NAME>
The query
SELECT SYS_XMLGEN(KundenNr,Name).getStringVal()
FROM Kunde;
doesn't work.
Thanks.