Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在sql/JSON(Oracle数据库)中构造嵌套的JSON值_Sql_Json_Database_Oracle_Serialization - Fatal编程技术网

在sql/JSON(Oracle数据库)中构造嵌套的JSON值

在sql/JSON(Oracle数据库)中构造嵌套的JSON值,sql,json,database,oracle,serialization,Sql,Json,Database,Oracle,Serialization,如何将嵌套的JSON值作为序列化字符串来构造JSON值?我试过这个: SQL> select json { 'y' : json_serialize(json('{"hello":"world"}')) } x from dual; X -------------------------------------------------------------------- {"y":{"hello&q

如何将嵌套的JSON值作为序列化字符串来构造JSON值?我试过这个:

SQL>  select json { 'y' : json_serialize(json('{"hello":"world"}')) } x
      from dual;  

X
--------------------------------------------------------------------
{"y":{"hello":"world"}}
但我想要的结果是:

{"y":"{\"hello\":\"world\"}"}

我使用的是Oracle数据库20c。

对象构造函数将
JSON\u serialize
的输出识别为序列化JSON,并在构造外部对象时将其转换为JSON值。改为使用
来\u clob()

select json { 'y' : to_clob(json('{"hello":"world"}')) } x
from dual;