Hi,
I working with XMLELEMENT in my select to create an xmltype. I am wondering if it's possible to have the value of the column be the name of the xmlelement? Here's my query:
it produces
What I would like to have returned is
So, is it possible to have the name of my element be a value of the site_use_code column?
Thank you!
Mike
I working with XMLELEMENT in my select to create an xmltype. I am wondering if it's possible to have the value of the column be the name of the xmlelement? Here's my query:
Code:
SELECT XMLElement("result",
XMLAGG(XMLElement("freight_term",
XMLAttributes(site_use_code as "site_use_code"),
uses.freight_term)))
INTO result
FROM nic_hz_cust_acct_sites_snp sites,
nic_hz_cust_site_uses_snp uses,
apps.nipp_frs_line_v frs
WHERE sites.cust_acct_site_id = uses.cust_acct_site_id
and sites.party_site_id = v_party_site_id
and frs.ship_method_code = uses.ship_via
it produces
Code:
<result>
<freight_term site_use_code="SHIP_TO">Pay to Export Point</freight_term>
<freight_term site_use_code="BILL_TO">Prepaid</freight_term>
</result>
What I would like to have returned is
Code:
<result>
<ship_to>Pay to Export Point</ship_to>
<bill_to>Prepaid</bill_to>
</result>
So, is it possible to have the name of my element be a value of the site_use_code column?
Thank you!
Mike