I am working in JSON_ARRAYAGG in Oracle .I have a scenario that Json array have 2 attributes. One attribute is hardcode value another one fetches value from outer query .
I want to skip whole Json_array to be skipped when the second attribute returns null value. Though I am giving "absent on null returning blob".but still I cant able to achieve that. Any possibilities to arrest that in Oracle.
My query:
'field' VALUE
SELECT JSON_ARRAYAGG(
JSON_OBJECT(
'@type' VALUE 'idtype'
'@value' VALUE tbl.value absent on null returning blob)absent on null returning blob)
from (select * from table tbl)
Expected output :
Null
Actual output:
"field": [
{
"@type": "idtype"
}
],