I have a problem with XMLQuery in Oracle XE.
When I execute the request below in an Oracle XE database, the result I obtained is null.
SELECT XMLQUERY('//people/person'
PASSING BY VALUE c.contentxml RETURNING CONTENT) as xml
FROM xml_column c;
I can’t find an error in that query, so I tried to execute it in an Oracle 12c database. And I got the result I expected.
I found a solution for that problem. The solution is to specify a return clause as shown below.
SELECT XMLQUERY('for $pers in //people/person return $pers'
PASSING BY VALUE c.contentxml RETURNING CONTENT) as xml
FROM xml_column c;
My question is why do I need to specify the return statement in an Oracle XE database ?
Is there a difference with the XMLQuery between the Oracle XE version and Oracle 12c version ? Or do I need to do anything specific ?