Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SYS_XMLGEN

420739May 29 2004 — edited May 29 2004
Hi,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2004
Added on May 29 2004
1 comment
294 views