ik denk dat je verschillende output nodig hebt, zoals hieronder
<?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>
hiervoor is geen tweede cursor nodig. u kunt bereiken zoals hieronder
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
;
sinds de distint
is bij deze gelegenheid anders. daarom is er geen subcursor vereist. hier distinct
zal alle records in de subquery zelf verwijderen.