0

in oracle 19c plsql i have such string

[{"Books":"book1","pages":"100"},{"Books":"book1","pages":"200"}]

i want to parse it using dbms_json to get table

Books pages
book1 100
book2 200

how to do this? anyone can help?

1

1 Answer 1

0

You can use the JSON_TABLE function to take a JSON string and convert it to a table structure.

SELECT *
  FROM JSON_TABLE ('[{"Books":"book1","pages":"100"},{"Books":"book1","pages":"200"}]',
                   '$[*]'
                   COLUMNS books PATH '$.Books', pages PATH '$.pages');
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.