Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

loading JSON question

oraLaroFeb 20 2024 — edited Feb 20 2024

oracle 19.19

Ive been given a text file with some JSON data and have to load into a flat table. I havent used JSON data before.

Data looks like this, each line is a line in the file.

[
 {
   "ID": "123",
   "Date": "2024-01-27",
   "Price": "10"
 },
 {
   "ID": "124",
   "Date": "2024-01-28",
   "Price": "10"
 } 
]

The data is on every line, if I create an external table over it and select from it, I get 12 lines of data. thats as varchar. How to get it into flat format of (ID, DATE, PRICE)? Ive tried every combination of json functions I can find but not getting it. Hoping wont be too hard.

This post has been answered by Barbara Boehmer on Feb 20 2024
Jump to Answer
Comments
Post Details
Added on Feb 20 2024
8 comments
152 views