XQuery | (OR) Returns Erroneous Results In 12c

(Doc ID 2376610.1)

Last updated on APRIL 05, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Information in this document applies to any platform.

Symptoms

Running the following query returns different results in 11.2.0.3 and 12.2.0.1.0:

select xtab1.linked_xml
from xmltable('//LinkCreate|//LinksCreate'
passing XMLType('<IPCreate>
<LinkCreate
AfterTimestamp="2018-01-25T10:42:20.113" URN="15201">
<ProcURN>1234</ProcURN>
</LinkCreate>
<LinkCreate
AfterTimestamp="2018-01-25T10:42:20.133" URN="15202">
<ProcURN>1235</ProcURN>
</LinkCreate>
</IPCreate>')
columns linked_xml xmltype path '//LinkCreate|//LinksCreate')
xtab1;

+In 11.2.0.3 the results are correct:
LINKED_XML
------------------------------------------------------------------------------
--
<LinkCreate AfterTimestamp="2018-01-25T10:42:20.113"
URN="15201"><ProcURN>1234</
ProcURN></LinkCreate>

<LinkCreate AfterTimestamp="2018-01-25T10:42:20.133"
URN="15202"><ProcURN>1235</
ProcURN></LinkCreate>

In 12c:
LINKED_XML
------------------------------------------------------------------------------
--
<LinkCreate AfterTimestamp="2018-01-25T10:42:20.113"
URN="15201"><ProcURN>1234</
ProcURN></LinkCreate><LinkCreate AfterTimestamp="2018-01-25T10:42:20.133"
URN="1
5202"><ProcURN>1235</ProcURN></LinkCreate>

<LinkCreate AfterTimestamp="2018-01-25T10:42:20.113"
URN="15201"><ProcURN>1234</
ProcURN></LinkCreate><LinkCreate AfterTimestamp="2018-01-25T10:42:20.133"
URN="1
5202"><ProcURN>1235</ProcURN></LinkCreate>

Both environments return 2 rows, however 11g returns one node per row
returned, which is correct, while 12c returns both nodes in each row
returned.



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms