My Oracle Support Banner

XQuery | (OR) Returns Erroneous Results In 12c (Doc ID 2376610.1)

Last updated on MARCH 09, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A 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.



Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.