XML from Data Base Examples
SX-E-4 Making an XML element with attribute, a text content and a sublement
XML element with attribute, a text content and a sublement
Example 4
This example shows a use of the XMLELEMENT() for creating the xml element 'Employee' with the 'EmployeeID' attribute, text content that is concatenations of the value of the 'FirstName' column, of the blank character and of the value of the 'LastName', and the 'Title' subelement having 'title' attribute.
select XMLELEMENT ('Employee', XMLATTRIBUTES ("EmployeeID"), "FirstName"||' '||"LastName",
XMLELEMENT("Title", XMLATTRIBUTES ( "Title" as "title")))
from "Demo"."demo"."Employees";
| View the source | Action |
|---|---|
| 1. sx_e_4_sample.vsp | Run |
OpenLink Home
Technical Support