Reputation: 1147
I am new to oracle and hence trying to write a query which will return xml from the relational table emp_metadata which has following columns emp_id and emp_name. The following query is returning null.
SELECT XMLElement("Emp",
XMLElement("ID", e.emp_id),
XMLElement("Name", e.emp_name)) AS "RESULT"
FROM emp_metadata e;
Any help or hint will be really appreciated.
Upvotes: 1
Views: 365
Reputation: 1147
Get it resolved by converting the output using .getClobVal(). Below is the query
SELECT XMLElement("Emp",
XMLElement("ID", e.emp_id),
XMLElement("Name", e.emp_name))**.getClobVal()** AS "RESULT"
FROM emp_metadata e;
Upvotes: 3