Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Access nested JSON array that is double quoted

Mark WooldridgeNov 4 2022

How do I access the elements of TaskArray?
with q as (
select '[
{
"ID": 9801,
"ComponentID": null,
"Component": null,
"OrderNumber": 1172,
"GroupID": 3,
"SubmittedDate": "10/03/2020 10:01",
"ValidationStatus": "Approved",
"TaskArray": "[{\"Stage\":\"Shelf\",\"TaskID\":\"9\",\"TaskName\":\"Build Virtual Server\",\"TaskTeam\":\"OSOS\"}]"}]' doc
from dual)
select a.*
from q,
json_table(q.doc, '$[*]'
columns
identifier number path '$.ID',
task_array clob path '$.TaskArray',
nested '$.TaskArray'
columns (
stage varchar2(250) path '$.Stage')) a
/
IDENTIFIER TASK_ARRAY STAGE
---------- ------------------------------------------------------------ ----------
9801 [{"Stage":"Shelf","TaskID":"9","TaskName":"Build Virtual Ser

1 row selected.

Comments

Processing

Post Details

Added on Nov 4 2022
2 comments
22 views