14.9.4 Seeing How Duality View Simplifies Logic
Compare the 26ai duality view API with the 19c version to see how much code it removes.
Using
JSON type and a Duality View simplifies many aspects of the
REST API implementation with custom business logic. For this action items REST API
example, the 26ai version requires 51% less code to implement the same functionality:
- 158 lines in
ACTION_ITEMS_DV_API, versus - 325 lines in Oracle 19c-compatible
ACTION_ITEMS_API.
- Saving JSON Using SQL Without Parsing
Save JSON directly through a duality view without parsing it into PL/SQL records. - Transforming JSON Declaratively in SQL
UseJSON_TRANSFORMto add, change, or remove JSON elements declaratively in SQL. - Processing and Accessing JSON Easily
Process nested JSON values directly withJSON_TABLEandJSON_VALUE. - Querying Predefined JSON Structure
Query the duality view’sDATAcolumn to return JSON in the required structure. - Inspecting the Core 26ai Action Item API
Inspect the 26ai API package that saves JSON through a duality view.
Parent topic: Simplifying REST APIs in Oracle 26ai