24 JSON Data Guide
A JSON data guide lets you discover information about the structure and content of JSON documents stored in Oracle Database.
Some ways that you can use this information include:
-
Generating a JSON Schema document that describes a set of JSON documents.
-
Generating a JSON Schema document that you can use to validate JSON documents.
-
Creating views that you can use to perform SQL operations on the data in the documents.
-
Automatically adding or updating virtual columns that correspond to added or changed fields in the documents.
_________________________________________________________
See Also:
JSON Schema- Overview of JSON Data Guide
A data guide is a summary of the structural and type information contained in a set of JSON documents. It records metadata about the fields used in those documents. - Persistent Data-Guide Information as Part of a JSON Search Index
JSON data-guide information can be saved persistently as part of the JSON search index infrastructure. This information is then updated automatically as new JSON content is added. You specify this optional behavior when you create a JSON search index. - Data-Guide Formats and Ways of Creating a Data Guide
There are three formats for a data guide: flat, hierarchical, and schema. All are available in SQL and PL/SQL asCLOB
JSON documents. Both hierarchical and schema data guides are JSON Schema documents (that is, JSON schemas), but only schema format is designed for validating JSON documents. - JSON Data-Guide Fields
The predefined fields of a JSON data guide are described. They include JSON Schema fields and Oracle-specific fields. - Data-Dictionary Views For Persistent Data-Guide Information
You can query static data-dictionary views to see which tables have JSON columns with data guide-enabled JSON search indexes and to extract JSON object field information that is recorded in dataguide-enabled JSON search indexes. - Specifying a Preferred Name for a Field Column
You can project JSON fields from your data as non-JSON columns in a database view or as non-JSON virtual columns added to the same table that contains the JSON column. You can specify a preferred name for such a column. - Creating a View Over JSON Data Based on Data-Guide Information
Based on data-guide information, you can create a database view whose columns project particular scalar fields from a set of JSON documents. - Adding and Dropping Virtual Columns For JSON Fields Based on Data-Guide Information
Based on data-guide information for a JSON column, you can project scalar fields from that JSON data as virtual columns in the same table. The scalar fields projected are those that are not under an array. - Change Triggers For Data Guide-Enabled Search Index
When JSON data changes, some information in a data guide-enabled JSON search index is automatically updated. You can specify a procedure whose invocation is triggered whenever this happens. You can define your own PL/SQL procedure for this, or you can use the predefined change-trigger procedureadd_vc
. - Multiple Data Guides Per Document Set
A data guide reflects the shape of a given set of JSON documents. If a JSON column contains different types of documents, with different structure or type information, you can create and use different data guides for the different kinds of documents. - Querying a Data Guide
A data guide is information about a set of JSON documents. You can query it from a flat data guide that you obtain using either Oracle SQL functionjson_dataguide
or PL/SQL functionDBMS_JSON.get_index_dataguide
. In the latter case, a data guide-enabled JSON search index must be defined on the JSON data. - A Flat Data Guide For Purchase-Order Documents
The fields of a sample flat data guide are described. It corresponds to a set of purchase-order documents. - A Hierarchical Data Guide For Purchase-Order Documents
The fields of a sample hierarchical data guide are described. It corresponds to a set of purchase-order documents. - A Schema Data Guide For Purchase-Order Documents
The fields of a sample JSON-Schema data guide are described. It corresponds to a set of purchase-order documents.
Parent topic: Query JSON Data