|
5 | 5 | - database
|
6 | 6 | - relational
|
7 | 7 | type: Case Study
|
8 |
| -cover: /img/posts/2025/oracle-case-study/blog_frontpage.webp |
| 8 | +cover: /img/posts/2025/oracle-case-study/banner.webp |
9 | 9 | authors:
|
10 | 10 | - name: Loïc Lefèvre
|
11 | 11 | photo: /img/avatars/loiclefevre.webp
|
@@ -594,13 +594,13 @@ With all this in place, our React frontend can now create the following form:
|
594 | 594 |
|
595 | 595 | 
|
596 | 596 |
|
597 |
| -> 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 |
| -> ```sql |
599 |
| -> ALTER TABLE products MODIFY name ANNOTATIONS ( |
600 |
| -> REPLACE "title" 'Product name' |
601 |
| -> ); |
602 |
| -> ``` |
603 |
| -> |
| 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: |
| 598 | +```sql |
| 599 | +ALTER TABLE products MODIFY name ANNOTATIONS ( |
| 600 | + REPLACE "title" 'Product name' |
| 601 | +); |
| 602 | +``` |
| 603 | +</Infobox> |
604 | 604 |
|
605 | 605 |
|
606 | 606 | #### JSON Relational Duality View
|
@@ -721,7 +721,7 @@ 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 |
| -> 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). |
| 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> |
725 | 725 |
|
726 | 726 | #### POST method
|
727 | 727 |
|
@@ -755,7 +755,7 @@ With 23ai, a check constraint can now be marked as [`PRECHECK`](https://docs.ora
|
755 | 755 |
|
756 | 756 | 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 | 757 |
|
758 |
| -> 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. |
| 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> |
759 | 759 |
|
760 | 760 | ```sql
|
761 | 761 | -- Mark check constraints as PRECHECK
|
@@ -1016,7 +1016,7 @@ select p.content.publishedDate.timestamp() + interval '5' day
|
1016 | 1016 | from posts p;
|
1017 | 1017 | ```
|
1018 | 1018 |
|
1019 |
| -> 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. |
| 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> |
1020 | 1020 |
|
1021 | 1021 | 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.
|
1022 | 1022 |
|
@@ -1101,7 +1101,7 @@ Results:
|
1101 | 1101 | | {<br/> "firstName": "Bob",<br/> "address": "Paris",<br/> "vat": false<br/>} |Paris|Bob|false|null|
|
1102 | 1102 | | {<br/> "firstName": "Bob",<br/> "address": "Paris",<br/> "vat": false,<br/> "tableEvolve": true<br/>} |Paris|Bob|false|true|
|
1103 | 1103 |
|
1104 |
| -> 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. |
| 1104 | +<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> |
1105 | 1105 |
|
1106 | 1106 | ## Conclusion
|
1107 | 1107 |
|
|
0 commit comments