Jeg tror, du har brug for et særskilt output som nedenfor
<?xml version="1.0"?>
<ROWSET>
<ROW>
<CONTACTS>
<CONTACTS_ROW>
<CONTACT_NAME>ALBERT EINSTEIN</CONTACT_NAME>
<INVOICE_NUMBER>123456</INVOICE_NUMBER>
<INVOICE_AMOUNT>10000</INVOICE_AMOUNT>
<INVOICE_CURRENCY>EUR</INVOICE_CURRENCY>
</CONTACTS_ROW>
</CONTACTS>
</ROW>
</ROWSET>
for dette kræves ingen anden markør. du kan opnå som nedenfor
select dbms_xmlgen.getxml('
select
cursor (
select
distinct
''ALBERT EINSTEIN'' CONTACT_NAME
, 123456 INVOICE_NUMBER, 10000 INVOICE_AMOUNT, ''EUR'' INVOICE_CURRENCY
from
ALL_VIEWS
where view_name IN ( ''ALL_INDEXES'', ''ALL_TABLES'')
) AS CONTACTS
from dual
') from dual
;
siden distint
er anderledes i denne lejlighed. der kræves derfor ingen undermarkør. her distinct
vil selv fjerne alle poster i underforespørgslen.