By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select * from V$VERSION;
BANNER | BANNER_FULL | BANNER_LEGACY | CON_ID |
---|---|---|---|
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production | Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production Version 18.4.0.0.0 |
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production | 0 |
create table myjson (data nclob check (data is json));
insert into myjson values ('{"a": {"b": {"c": 1}}}');
1 rows affected
insert into myjson values ('{"content": "something"}');
1 rows affected
select * from myjson where json_query(myjson.data, '$.a') = '{"b": {"c": 1}}';
select * from myjson where json_query(myjson.data, '$.a') = json_query('{"b": {"c": 1}}', '$');
DATA |
---|
{"a": {"b": {"c": 1}}} |
select * from myjson where json_query(myjson.data, '$.a') = dbms_lob.substr('{"b": {"c": 1}}');
select * from myjson where json_query(myjson.data, '$.a') = json_query('{"val": {"b": {"c": 1}}}', '$.val');
DATA |
---|
{"a": {"b": {"c": 1}}} |
select * from myjson where json_value(myjson.data, '$.content') = 'something';
DATA |
---|
{"content": "something"} |
select * from myjson where json_value(myjson.data, '$.content') = json_value('"something"', '$');
select * from myjson where json_value(myjson.data, '$.content') = json_value('{"val": "something"}', '$.val');
DATA |
---|
{"content": "something"} |