Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLELEMENT

Status
Not open for further replies.

MikeAJ

Programmer
May 22, 2002
108
US
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:
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top