2

I want to convert a json array into a set of rows in Oracle.

Input:

'["a","b","c"]'

Output:

col_name
---------
a
b
c

PostgreSQL provides the function, jsonb_array_elements(jsonb) to do this.

How can I do this in Oracle 18c. Thank you.

1 Answer 1

6

You can use JSON_TABLE

SELECT value
FROM json_table( (select js from samp) , '$[*]'
                COLUMNS (value PATH '$')
               )

Replace js with your columnname & samp with your tablename in the above query

Check Demo Here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.