File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed
data-platform/autonomous-database/autonomous-json/oracle23ai-json-views-support Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ ## Oracle Database 23ai support for JSON Duality and Collection Views
2+
3+ This repository contains scripts demonstrating support for Oracle JSON views in Oracle Database 23ai and Oracle API for MongoDB
4+
5+
6+ ## Requirements
7+ - mongosh installed
8+ - SQL Cl installed
9+ - Oracle Database 23ai with Oracle API for MongoDB enabled
10+ - HR database sample schema installed
11+
12+ ## License
13+
14+ Copyright (c) 2025 Oracle and/or its affiliates.
15+
16+ Licensed under the Universal Permissive License (UPL), Version 1.0.
17+
18+ See [ LICENSE] ( https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE ) for more details.
19+
Original file line number Diff line number Diff line change 1+ show collections
2+
3+ db . deptview . find ( )
4+ db . deptview . insertOne ( { _id :'991' , dname :'human resources' , location :1700 } )
5+
6+ db . empview . find ( )
Original file line number Diff line number Diff line change 1+ select *
2+ from user_json_collections;
3+
4+ soda list
5+
Original file line number Diff line number Diff line change 1+ drop view empview;
2+ drop view deptview;
3+ drop table departments cascade constraints;
4+ drop table employees cascade constraints;
5+
6+ create table departments
7+ as
8+ select *
9+ from hr .departments ;
10+
11+ create table employees
12+ as
13+ select *
14+ from hr .employees ;
15+
16+ alter table departments add primary key (department_id);
17+ alter table employees add primary key (employee_id);
18+
19+ create or replace json collection view empview
20+ as
21+ select json{' _id' : employee_id,
22+ last_name,
23+ hire_date,
24+ salary}
25+ from employees;
26+
27+ select *
28+ from user_json_collections;
29+
30+ create or replace json relational duality view deptview as
31+ select json {' _id' : department_id,
32+ ' dname' : department_name,
33+ ' location' : location_id}
34+ from departments with insert update delete ;
35+
You can’t perform that action at this time.
0 commit comments