I'm trying to get Oracle to produce JSON null values on SQL NULL data, as follows:
select 
  json_object(key 'a' value 1, key 'b' value null null on null)   c1, 
  json_object(key 'a' value 1, key 'b' value null absent on null) c2
from dual;
Or also:
select 
  json_object(key 'a' value a, key 'b' value b null on null)   c1, 
  json_object(key 'a' value a, key 'b' value b absent on null) c2
from (
  select 1 a, null b
  from dual
) t;
Unfortunately, both queries result in:
|C1        |C2        |
|----------|----------|
|{"a":1}   |{"a":1}   |
I would have expected this, instead:
|C1                 |C2        |
|-------------------|----------|
|{"a":1,"b":null}   |{"a":1}   |
What am I missing? I'm using Oracle XE 18c
 
     
     
     
    