使用plsql将json对象附加或附加到另一个json对象json对象中

问题描述

伙计们,我有一个需要解决的问题: 我如何将一些json对象附加到另一个json数组对象中?

下面的示例:

create table departments_json (
  department_id   integer not null primary key,department_data blob not null
);

alter table departments_json
add constraint dept_data_json 
check ( department_data is json );

insert into departments_json 
json values ( 110,utl_raw.cast_to_raw ( '{
  "department": "Accounting","employees": [
    {
      "name": "Higgins,Shelley","job": "Accounting Manager","hireDate": "2002-06-07T00:00:00"
    },{
      "name": "Gietz,William","job": "Public Accountant","hireDate": "2002-06-07T00:00:00"
    }
  ]
}' ));

select department_id,utl_raw.cast_to_varchar2(department_data)
from departments_json
where department_id = 110;

我知道了:

enter image description here

现在我有了另一个json:

{
  "employees": [
    {
      "name": "Chen,John","job": "Accountant","hireDate": "2005-09-28T00:00:00"
    },{
      "name": "Greenberg,Nancy","job": "Finance Manager","hireDate": "2002-08-17T00:00:00"
    },{
      "name": "Urman,Jose Manuel","hireDate": "2006-03-07T00:00:00"
    }
  ]
}

我需要在第一个json对象中附加新的3个对象,以具有如下内容:

enter image description here

有人可以帮忙吗?我没有正确的方法。

我使用本教程LINK尝试了一些操作,但是什么也没做。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)