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!

JSON_TABLE - how to extract columns when the first key value dynamically changes

DaveSJun 11 2019 — edited Jun 20 2019

Hi

I have the json output data below. As you can see the first value/key returned is the lowercase currency code, followed by the nested values for that currency code. How can I use the JSON_TABLE function to return relational data in the form currency, code, rate, date?

Tks

{

eur: {

code: "EUR",

rate: 0.88628275220025,

date: "Tue, 11 Jun 2019 12:00:01 GMT"

},

gbp: {

code: "GBP",

rate: 0.786891038587,

date: "Tue, 11 Jun 2019 12:00:01 GMT"

},

chf: {

code: "CHF",

rate: 0.99284202217432,

date: "Tue, 11 Jun 2019 12:00:01 GMT"

}

}

Comments
Post Details
Added on Jun 11 2019
3 comments
4,046 views