Discovery of the day on Oracle 19 version EE 19.21.0.0.0:
JSON_OBJECT_T.GET_CLOB(key) member function returns a CLOB string containing 'null' (lowercase), not a NULL value.
As you can see below the 'null' string is matched by the function NULLIF which replaces it with a real NULL value:
set serveroutput on declare l_procedure clob; j_job_desc json_object_t; begin j_job_desc := json_object_t.parse('{"procedure":null}'); l_procedure := nullif(j_job_desc.get_clob('procedure'),'null'); if l_procedure is null then dbms_output.put_line('nothing'); else dbms_output.put_line(l_procedure); end if; end; /The documentation doesn't explain this behavior at all, it just says that the member function will create a CLOB implicitly and that's all,
nothing
PL/SQL procedure successfully completed.
No comments:
Post a Comment