Skip to content

Commit

Permalink
WMS ID #4004: Minor Fixes (#643)
Browse files Browse the repository at this point in the history
* Self-QA Updates

Adding workshop changes to further align with the Self-QA checklist.

* Update adb-free-container-setup.md

* Post-Testing Edits V1

* Update adb-free-container-setup.md

* Post-Testing Changes V2

* Updating Screenshots

* WMSID# 11693: Adding the initial workshop structure.

* Update adb-free-container-setup.md

* Update adb-free-container-setup.md

* [WMS ID #11029] DB Collective - JSON Duality Search

* WMS ID #11029: Minor fix

* Update manifest.json

* LL ID #4004: Add JSON Duality Intro

* LL ID# 4004: Minor Updates

* LL ID #4004: Minor updates.

* WMS ID #11693: Revising the workshop structure.

* WMS ID# 11693

* HOL 46

* DB Collective - JSON Updates

* LL ID #4004: DB Collective Changes

* OCW & DB Collective Updates

* Update new-duality-views-15.md

* Update new-duality-views-15.md

* Update new-duality-views-15.md

* Update new-duality-views-15.md

* Update new-duality-views-15.md

* Update new-duality-views-15.md

---------

Co-authored-by: William Masdon <[email protected]>
Co-authored-by: Hope Fisher <[email protected]>
  • Loading branch information
3 people authored Aug 19, 2024
1 parent eda4154 commit dce954a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions db-23ai-fundamentals/new-duality-views/new-duality-views-15.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Welcome to the "Exploring JSON Relational Duality with SQL" lab. In this lab, yo

This lab is only intended to give you a small taste of what Duality Views have to offer. For full, in-depth free workshops, follow this [link](https://livelabs.oracle.com/pls/apex/f?p=133:100:110578183178299::::SEARCH:duality%20views).

**_Estimated Lab Time: 20 minutes_**
**_Estimated Lab Time: 15 minutes_**

### **Objectives**

Expand All @@ -21,7 +21,7 @@ This lab assumes you have:

## Task 1: Create Relational Tables

1. Create relational tables for customer data and order records. The following code block creates two tables for customer and order data. Copy and run the following SQL script:
1. Create the 'customers' and 'orders' relational tables. The following code block creates two tables for customer and order data. Copy and run the following SQL script:
```
<copy>
DROP TABLE if exists orders CASCADE CONSTRAINTS;
Expand Down Expand Up @@ -60,7 +60,6 @@ This lab assumes you have:
</copy>
```
## Task 2: Create JSON Relational Duality Views
1. Create a duality view of the customers table. We'll use this one to manage our customer information.
Expand Down Expand Up @@ -192,7 +191,7 @@ This lab assumes you have:
![Updating the our customers view](images/im4.png " ")
6. Let's now try and update Alice's last name. You'll see that this is not allowed!
2. Let's now try and update Alice's last name. You'll see that this is not allowed!
```
<copy>
Expand All @@ -207,7 +206,7 @@ This lab assumes you have:
```
![selecting from our customers table](images/im5.png " ")
7. Let's insert some orders for our customer Jim Brown using `mergepatch`.
3. Let's insert some orders for our customer Jim Brown using `mergepatch`.
```
<copy>
Expand All @@ -234,16 +233,15 @@ This lab assumes you have:
</copy>
```
8. Imagine we needed to change one of the Product IDs, for example product_id = 202 shown below.
4. Imagine we needed to change one of the Product IDs, for example product_id = 202 shown below.
```
<copy>
SELECT json_serialize(data PRETTY) FROM customer_orders_dv;
</copy>
```
9. Using a single update statement, we can easily update product_id 202 to 999 in every JSON duality view.
5. Using a single update statement, we can easily update product_id 202 to 999 in every JSON duality view.
```
<copy>
Expand All @@ -257,6 +255,10 @@ This lab assumes you have:
</copy>
```
You can now see that the update made to the orders table has propogated to the customer orders duality view, and the same occurs for all other representations of the customers table!
**You've completed the workshop!**
Note that the "etag" value supplied in the content is used for "out-of-the-box" optimistic locking to prevent the well-known "lost update" problem that can occur with concurrent operations. During a replace operation, the database checks that the eTag provided in the replacement document matches the latest eTag of the target Duality View document.
If the eTags do not match, which can occur if another concurrent operation updated the same document, an error is thrown. If you get the error, you can reread the updated value (including the updated eTag), and retry the replace operation again, adjusting it (if desired) based on the updated value.
Expand Down

0 comments on commit dce954a

Please sign in to comment.