My Oracle Support Banner

Wrong Results on JSON Query. (Doc ID 2301973.1)

Last updated on MARCH 09, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

Symptoms

A JSON Query is giving wrong results.

Actaul Output:
============
SQL> SELECT jt.* FROM dac_t, JSON_TABLE(jdoc, '$' COLUMNS ("a" VARCHAR2(5) PATH '$.a', NESTED PATH '$.b[*]' COLUMNS ("c" VARCHAR2(5) PATH '$.c',"seq" FOR ORDINALITY, NESTED PATH '$.d[*]' COLUMNS ("d" NUMBER PATH '$')))) jt;

A C SEQ D
----- ----- ---------- ----------
a1 c1 1 1
a1 c1 2 2
a2 c2 1 3
a2 c2 2 4

Expected Output:
===============

SQL> SELECT jt.* FROM dac_t, JSON_TABLE(jdoc, '$' COLUMNS ("a" VARCHAR2(5) PATH '$.a', NESTED PATH '$.b[*]' COLUMNS ("c" VARCHAR2(5) PATH '$.c',"seq" FOR ORDINALITY, NESTED PATH '$.d[*]' COLUMNS ("d" NUMBER PATH '$')))) jt;
A C SEQ D
----- ----- ---------- ----------
a1 c1 1 1
a1 c1 1 2
a2 c2 1 3
a2 c2 2 4

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.