You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/blog/posts/oracle-case-study.md
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -594,14 +594,14 @@ With all this in place, our React frontend can now create the following form:
594
594
595
595

596
596
597
-
<Infobox> Interestingly, whenever you change the schema annotation in the database, it is immediately reflected inside your browser once you refreshed it. You can try with:
597
+
<blockquote>
598
+
Interestingly, whenever you change the schema annotation in the database, it is immediately reflected inside your browser once you refreshed it. You can try with:
598
599
```sql
599
600
ALTERTABLE products MODIFY name ANNOTATIONS (
600
601
REPLACE "title"'Product name'
601
602
);
602
603
```
603
-
</Infobox>
604
-
604
+
</blockquote>
605
605
606
606
#### JSON Relational Duality View
607
607
@@ -721,7 +721,9 @@ Running the 2 queries above respectively returns the data in JSON format:
721
721
|Wooden spatula|4.99|42|
722
722
|Other nice product|5|10|
723
723
724
-
<Infobox>The `_metadata` object will contain additional information such as an `etag` that can be used for [optimistic concurrency control](https://docs.oracle.com/en/database/oracle/oracle-database/23/jsnvu/using-optimistic-concurrency-control-duality-views.html).</Infobox>
724
+
<blockquote>
725
+
The `_metadata` object will contain additional information such as an `etag` that can be used for [optimistic concurrency control](https://docs.oracle.com/en/database/oracle/oracle-database/23/jsnvu/using-optimistic-concurrency-control-duality-views.html).
726
+
</blockquote>
725
727
726
728
#### POST method
727
729
@@ -755,7 +757,9 @@ With 23ai, a check constraint can now be marked as [`PRECHECK`](https://docs.ora
755
757
756
758
Once a check constraint is marked as `PRECHECK`, you have the choice whether or not to disable the check constraint on the table as the retrieved JSON schema with `dbms_json_schema.describe()` will contain the check constraints as well.
757
759
758
-
<Danger>We do **NOT** advise to disable check constraints as it would allow inserting bad data into the relational tables directly. The remark about `PRECHECK` constraints is here to provide as much information as possible.</Danger>
760
+
<blockquote>
761
+
We do **NOT** advise to disable check constraints as it would allow inserting bad data into the relational tables directly. The remark about `PRECHECK` constraints is here to provide as much information as possible.
762
+
</blockquote>
759
763
760
764
```sql
761
765
-- Mark check constraints as PRECHECK
@@ -777,8 +781,6 @@ insert into products (name, price, quantity)
777
781
values ('Bad product', 0, -1);
778
782
779
783
commit;
780
-
781
-
select*from products;
782
784
```
783
785
784
786
### Data Use Case Domains
@@ -1016,7 +1018,9 @@ select p.content.publishedDate.timestamp() + interval '5' day
1016
1018
from posts p;
1017
1019
```
1018
1020
1019
-
<Infobox>We use the item method `timestamp()` in the last statement above because otherwise the SQL dot notation would return a SQL `JSON` (by default in 23ai) on which we cannot apply an interval operation. However, because the value is already stored as `TIMESTAMP` inside the binary JSON format, there will be *no conversion* from `JSON` to `timestamp` here.</Infobox>
1021
+
<blockquote>
1022
+
We use the item method `timestamp()` in the last statement above because otherwise the SQL dot notation would return a SQL `JSON` (by default in 23ai) on which we cannot apply an interval operation. However, because the value is already stored as `TIMESTAMP` inside the binary JSON format, there will be *no conversion* from `JSON` to `timestamp` here.
1023
+
</blockquote>
1020
1024
1021
1025
Last but not least, by enabling type casting, native SQL data type checks are also performed ensuring 100% fidelity between stored binary values in the encoded JSON and SQL data types. As a result, we can store not just the standard JSON data types but also the SQL data types inside the encoded binary JSON such as `NUMBER`, `DATE`, `TIMESTAMP`, `TIMESTAMP WITH TIME ZONE`, `INTERVAL`, `RAW`, `VECTOR`, etc.
<Infobox>The trigger executes asynchronously, hence not delaying DML response times, however, because of it being asynchronous, it may take a second before you will see the new virtual column.</Infobox>
1108
+
<blockquote>
1109
+
The trigger executes asynchronously, hence not delaying DML response times, however, because of it being asynchronous, it may take a second before you will see the new virtual column.
1110
+
</blockquote>
1105
1111
1106
1112
## Conclusion
1107
1113
1108
1114
We have shown lots of features inside the Oracle Database 23ai which provide powerful capabilities to have JSON data coexist with relational data, and JSON schema clearly strengthens this even more. But this is only the beginning and as you discover more and more features that work the same way regardless of the data model, or that allow going back and forth from one model to another, you'll understand the true value of a converged database which has one goal: removing barriers, simplifying architecture and making developers more productive!
1109
1115
1110
1116

-[Getting started with Oracle Database 23ai](https://medium.com/db-one/oracle-database-download-install-tutorial-my-getting-started-guide-044925c10ca2)
0 commit comments