79392554

Date: 2025-01-28 01:18:37
Score: 1
Natty:
Report link

short answer use the JSON_ON_NULL_CLAUSE

See the documentation at

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/JSON_OBJECT.html

SELECT JSON_OBJECT('test' VALUE null ABSENT ON NULL) from dual ;

Will give you {}

The other option is NULL ON NULL which is the default and will give you

{"test":null}

Reasons:
  • Low length (0.5):
  • No code block (0.5):
Posted by: Shaun Peterson