I just noticed that an empty string is not the same as null, at least for the PLSQL json_object_t type on a 12.2.0.1.0 database
See for instance
declare
l_json json_object_t;
l_x varchar2(10);
begin
l_json := json_object_t();
l_json.put( 'a', '' );
l_json.put( 'b', to_char( null ) );
l_json.put( 'c', l_x );
l_json.put( 'd', nvl(l_x,'') );
l_x := null;
l_json.put( 'e', l_x );
l_x := '';
l_json.put( 'f', l_x );
dbms_output.put_line( l_json.to_string );
end;
{"a":"","b":null,"c":null,"d":"","e":null,"f":""}
Does anyone know if this is documented somewhere?
The only thing I can find says the opposite: zero length character value is treated as null: https://docs.oracle.com/database/121/SQLRF/sql_elements005.htm#SQLRF30037