Forum Stats

  • 3,872,222 Users
  • 2,266,407 Discussions
  • 7,911,107 Comments

Discussions

XMLQuery Problem with Oracle XE

chloe.trachsel
chloe.trachsel Member Posts: 1
edited Apr 9, 2017 11:47AM in XQuery

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 ?

Answers

  • odie_63
    odie_63 Member Posts: 8,493 Silver Trophy
    edited Apr 9, 2017 11:47AM

    Hi Chloe,

    I don't see anything wrong either with the first query.

    You shouldn't be needing a FLWOR expression in this case.

    Are you sure it's not a mere data issue? Empty table?

This discussion has been closed.