xQuery question

From: Stefan Knecht <knecht.stefan_at_gmail.com>
Date: Tue, 22 Dec 2020 09:28:11 +0700
Message-ID: <CAP50yQ8jQR4o8MhnJ=adKj4a9O5RfPz_B4Z_neXsHQk1nmzf+w_at_mail.gmail.com>



Hi all

Been wrapping my head around this for too long and need a fresh set of eyes :)

Simple case:

select xmlquery('xquery version "1.0"; copy $d := . modify insert nodes $parent/$child as last into $d/root return $d ' passing xmltype('<root></root>'), xmltype('<child>123</child>') as "child", xmltype('<parent>456</parent>') as "parent" returning content ) as x from dual;

What I'd expect:

<root>
<parent>

  <child>123</child>
</parent>
</root>

But it's ignoring the parent and giving me only:

<root>

  <child>123</child>
</root>

I can't see why, but I must be missing something obvious.

Stefan

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Dec 22 2020 - 03:28:11 CET

Original text of this message