How to extract specific array item with json_value
Hi,
I have a json data as below and I can use the below SQL to extract the Subject value
SELECT JSON_VALUE('{"payload": {
"partId": "",
"mimeType": "text/html",
"filename": "",
"headers": [
{
"name": "Delivered-To",
"value": "sndata@abc.com"
},
{
"name": "Subject",
"value": "Testing subject"
}]}}', '$.payload.headers[1].value' ERROR ON ERROR) AS value
FROM DUAL;
provided the JSON has fix content sequence in the headers section.
If the headers array items sequence is not fixed, how should I get the value for the array item with name="Subject" ?
Thanks
Pek