Skip to Main Content

SQL & PL/SQL

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.

Parse JSON with dynamic nodes

Veerendra PatilFeb 7 2025

Hi,

I have JSON as

{
"activeSheetIndex": 0,
"sheets": {
"VP M1": {
"name": "VP M2",
"rowCount": 30,
"data": {
"dataTable": {
"0": {
"0": {
"value": "0"
},
"1": {
"value": "0"
},
"2": {
"value": "216897"
},
"3": {
"value": "216898"
},
"4": {
"value": "216899"
},
"5": {
"value": "216900"
}
},
"1": {
"0": {
"value": "-1"
},
"1": {
"value": "UNITTYPEIDS"
},
"2": {
"value": "A1"
},
"3": {
"value": "A2"
},
"4": {
"value": "A3"
},
"5": {
"value": "A4"
}
},
"2": {
"0": {
"value": "4517943"
},
"1": {
"value": "AA"
},
"2": {
"value": "10"
},
"3": {
"value": "11"
},
"4": {
"value": "12"
},
"5": {
"value": "13"
}
},
"3": {
"0": {
"value": "4517944"
},
"1": {
"value": "BB"
},
"2": {
"value": "20"
},
"3": {
"value": "21"
},
"4": {
"value": "22"
},
"5": {
"value": "23"
}
},
"4": {
"0": {
"value": "4517945"
},
"1": {
"value": "CC"
},
"2": {
"value": "30"
},
"3": {
"value": "31"
},
"4": {
"value": "32"
},
"5": {
"value": "33"
}
},
"5": {
"0": {
"value": "4517946"
},
"1": {
"value": "DD"
},
"2": {
"value": "40"
},
"3": {
"value": "41"
},
"4": {
"value": "42"
},
"5": {
"value": "43"
}
}
}
}
},
"VP M2": {
"name": "VP M2",
"rowCount": 30,
"data": {
"dataTable": {
"0": {
"0": {
"value": "0"
},
"1": {
"value": "0"
},
"2": {
"value": "216897"
},
"3": {
"value": "216898"
},
"4": {
"value": "216899"
},
"5": {
"value": "216900"
}
},
"1": {
"0": {
"value": "-1"
},
"1": {
"value": "UNITTYPEIDS"
},
"2": {
"value": "A1"
},
"3": {
"value": "A2"
},
"4": {
"value": "A3"
},
"5": {
"value": "A4"
}
},
"2": {
"0": {
"value": "4517943"
},
"1": {
"value": "AA"
},
"2": {
"value": "10"
},
"3": {
"value": "11"
},
"4": {
"value": "12"
},
"5": {
"value": "13"
}
},
"3": {
"0": {
"value": "4517944"
},
"1": {
"value": "BB"
},
"2": {
"value": "20"
},
"3": {
"value": "21"
},
"4": {
"value": "22"
},
"5": {
"value": "23"
}
},
"4": {
"0": {
"value": "4517945"
},
"1": {
"value": "CC"
},
"2": {
"value": "30"
},
"3": {
"value": "31"
},
"4": {
"value": "32"
},
"5": {
"value": "33"
}
},
"5": {
"0": {
"value": "4517946"
},
"1": {
"value": "DD"
},
"2": {
"value": "40"
},
"3": {
"value": "41"
},
"4": {
"value": "42"
},
"5": {
"value": "43"
}
}
}
}
}
}
}

The next node under “sheets” is dynamic. How do I parse that? I need to get the sheet name and the row/col values (they are under data.dataTable) The nodes here are also dynamic. Each node under data.dataTable is “row” (They are passed as “0”, “1” ..etc) and each node within this “row” is column. These nodes are also dynamic. Each column has a node “value”

My output would be something like

<table><tbody><tr><td style="height:16.0pt;width:65pt;">sheet Name</td><td style="width:65pt;">row</td><td style="width:65pt;">column</td><td style="width:65pt;">value</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">0</td><td style="text-align:right;">0</td><td>0</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">0</td><td style="text-align:right;">1</td><td>0</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">0</td><td style="text-align:right;">2</td><td>216897</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">0</td><td style="text-align:right;">3</td><td>216898</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">0</td><td style="text-align:right;">4</td><td>216899</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">0</td><td style="text-align:right;">5</td><td>216900</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">1</td><td style="text-align:right;">0</td><td>-1</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">1</td><td style="text-align:right;">1</td><td>XX</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">1</td><td style="text-align:right;">2</td><td>A1</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">1</td><td style="text-align:right;">3</td><td>A2</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">1</td><td style="text-align:right;">4</td><td>A3</td></tr><tr><td style="height:16.0pt;">VP M1</td><td style="text-align:right;">1</td><td style="text-align:right;">5</td><td>A4</td></tr></tbody></table>

– and similarly for VP M2 node

Please suggest.

Thanks.

This post has been answered by Paulzip on Feb 8 2025
Jump to Answer

Comments

chonewell Nov 12 2024

My Oracle Cloud tenant, cloud account, and secure email have no issues. Why haven't I received my password reset email for Oracle Cloud? This is very strange, and our attempts have not been able to solve the problem. May I ask who I should turn to for help?

L. Fernigrini Nov 12 2024

If your account is a paid one, open a Support ticket.

If it is a Free Tier then you will have to rely on help from the community. Most probable cause that you did not receive the password reset email is that your account has been stolen and the email has been changed.

chonewell Nov 13 2024

Thank you for your reply!
But when I chatted with the online customer service, they told me that my Oracle Cloud tenant, account, and email were all fine. So, there shouldn't be a problem of theft.
I have a free account, but who can I contact on the forum? I can only post, but no one on the forum can view my account permissions, right. I am currently trying to reset MFA, I don't know if it works.
It's quite ridiculous that I have a free account and can't enjoy any services, but how can I become a paid user if I can't log in to my account.

1 - 3

Post Details

Added on Feb 7 2025
2 comments
123 views