Examples
The following query concatenates the values from two XMLELEMENT functions:
SELECT Name,XMLCONCAT(XMLELEMENT("Para",Name),
XMLELEMENT("Para",Home_City)) AS ExportString
FROM Sample.Person
A sample row of the data returned would appear as follows:
ExportString
<Para>Emerson,Molly N.</Para><Para>Boston</Para>
The following query nests an XMLCONCAT within an XMLELEMENT function:
SELECT XMLELEMENT("Item",Name,
XMLCONCAT(
XMLELEMENT("Para",Home_City,' ',Home_State),
XMLELEMENT("Para",'is residence')))
AS ExportString
FROM Sample.Person
A sample row of the data returned would appear as follows:
ExportString
<Item>Emerson,Molly N.<Para>Boston MA</Para><Para>is residence</Para></Item>