select result from (
( SELECT
XMLElement("BUSINESSETITY",
XMLELEMENT("TYPE",'FACILITY'),
XMLELEMENT("NNUMBER",pk),
XMLELEMENT("SITENUMBER",''),
XMLELEMENT("DEPTNUMBER",'') ) result
from table 2
)
UNION ALL
(
select XMLElement("BUSINESSETITY",
XMLELEMENT("TYPE",'SITE'),
XMLELEMENT("TIONNUMBER",''),
XMLELEMENT("SITENUMBER",PK),
XMLELEMENT("DEPTNUMBER",'') ) result
from table2
)
I am using above code to covert rows into XML data and than doing a union.
But it giving me . different rows
What I want is one row which something like this
<BUSINESS>
<BUSINESSETITY> ...... </BUSINESSETITY>
<BUSINESSETITY> ...... </BUSINESSETITY>
<BUSINESSETITY> ...... </BUSINESSETITY>
<BUSINESSETITY> ...... </BUSINESSETITY>
..
..
...
</BUSINESS>
Can you pls help me. thanks a lot