| Oracle DBMS_JSON Version 26ai |
|---|
| General Information | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Library Note |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Purpose | Provides an interface for dataguide operations for those working with Java Script Object Notation inside the Oracle database. Be sure to also learn about the new function JSON_DATAGUIDE that takes as its input a table column of JSON data and, for each JSON document in the column, returns a flat data guide as a CLOB. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AUTHID | CURRENT_USER | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Constants |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Dependencies |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Documented | Yes: Packages and Types Reference | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Exceptions |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| First Available | 12.2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Security Model | Owned by XDB with EXECUTE granted to PUBLIC | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Source | {ORACLE_HOME}/rdbms/admin/dbmsjson.sql | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Subprograms |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ADD_VIRTUAL_COLUMNS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Add virtual columns based on dataguide information. On a shard catalog server no virtual column is added. Overload 1 |
dbms_json.add_virtual_columns( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.add_virtual_columns('J_PURCHASEORDER', 'PO_DOCUMENT', dbms_json.get_index_dataguide('J_PURCHASEORDER', 'PO_DOCUMENT', dbms_json.format_hierarchical)); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Overload 2 | dbms_json.add_virtual_columns( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.add_virtual_columns('J_PURCHASEORDER', 'PO_DOCUMENT', 50); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BLOB_TO_JSON | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Receives a table, and column and, if the column is of data type BLOB with an IS JSON FORMAT OSON constraint, converts the column to JSON type Check the corresponding BLOB2JSON procedure in DBMS_JSON_INT and it is clear that this procedure's parameters are wrong and this will not work until Oracle patches it correcting the missing owner parameter. |
dbms_json.blob_to_json( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CREATE TABLE B2JTEST ( |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CREATE_VIEW (new 23ai
overload) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Create a view with relational columns and scalar JSON fields as specified in a dataguide Overload 1 It is highly recommended that the second overload be easily create an error if two tables have the same name but are in different schemas. |
dbms_json.create_view( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.create_view('VIEW1', 'J_PURCHASEORDER', 'PO_DOCUMENT', dbms_json.get_index_dataguide('J_PURCHASEORDER', 'PO_DOCUMENT', dbms_json.format_hierarchical)); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Overload 2 | dbms_json.create_view( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.create_view('VIEW1',
'C##UWCLASS', 'J_PURCHASEORDER', 'PO_DOCUMENT', dbms_json.get_index_dataguide('J_PURCHASEORDER',
'PO_DOCUMENT', dbms_json.format_hierarchical)); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CREATE_VIEW_ON_PATH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Create a view based on dataguide information, with relational columns, top level scalar types, and fully expanded subtree under a given path. When running on the shard catalog server this raises an error stating that the dataguide is empty. | dbms_json.create_view_on_path( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.create_view_on_path('VIEW2', 'J_PURCHASEORDER', 'PO_DOCUMENT', '$'); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DETECT_DATETIME (new 23ai) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data Guide Date Time formatting | dbms_json.detect_datetime RETURN NUMBER PARALLEL ENABLE; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.detect_datetime;DETECT_DATETIME |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DROP_VIRTUAL_COLUMNS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Drop virtual columns created by procedure add_virtual_columns. This has no effect when running on the shard catalog server. | dbms_json.drop_virtual_columns( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.drop_virtual_columns(''J_PURCHASEORDER', 'PO_DOCUMENT'); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FORMAT_FLAT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data Guide Date Time formatting | dbns_json.format_flat RETURN NUMBER PARALLEL ENABLE; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.format_flat; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FORMAT_HIERARCHICAL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data Guide Hierarchical formatting | dbns_json.format_hierarchical RETURN NUMBER PARALLEL ENABLE; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.format_hierarchical; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FORMAT_SCHEMA (new 23ai) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data Guide Schema formatting | dbms_json.format_schema RETURN NUMBER PARALLEL ENABLE; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.format_schema; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GATHER_STATS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Undocumented but used for Data Guide formatting | dbms_json.gather_stats RETURN NUMBER PARALLEL ENABLE; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.gather_stats; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GEOJSON | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JSON Data Guide formatting | dbms_json.geoJSON RETURN NUMBER PARALLEL ENABLE; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.geoJSON; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET_INDEX_DATAGUIDE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Get JSON dataguide from a dataguide enabled JSON search index. When running on the shard catalog server returns NULL. Overload 1 |
dbms_json.get_index_dataguide( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.get_index_dataguide('UWJSON', 'PO', dbms_json.format_hierarchical, dbms_json.pretty); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Overload 2 | dbms_json.get_index_dataguide( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.get_index_dataguide('UWJSON', 'PO', dbms_json.format_hierarchical, dbms_json.pretty); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET_MVI_SPEC (new 23ai) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generates the multi-value index specs on a given index in JSON format Overload 1 |
dbms_json.get_mvi_spec( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.get_mvi_spec(USER, 'I_TAB1'); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Overload 2 | dbms_json.get_mvi_spec(indexName IN VARCHAR2) RETURN CLOB; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.get_mvi_spec('I_TAB1'); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET_MVI_SPECS (new 23ai) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generates all multi-value index specs on a given table in JSON format Overload 1 |
dbms_json.get_mvi_specs( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.get_mvi_specs(USER, 'TAB$); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Overload 2 | dbms_json.get_mvi_specs(tablename IN VARCHAR2) RETURN CLOB; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.get_mvi_specs(USER, 'TAB$); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET_VIEW_SQL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Similar to create_view, but returns the creating view DDL but does not execute the DDL and create the view | dbms_json.get_view_sql( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.create_view_on_path('VIEW3, 'J_PURCHASEORDER', 'PO_DOCUMENT', '$'); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JSON_TYPE_CONVERTIBLE_CHECK (new 23ai) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pre-upgrade check for the JSON type | dbms_json.json_type_convertible_check( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TBD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PREPALLJCOLINM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For tables containing json columns created prior to 12.2 upgrades all JSON columns to to take advantage of in-memory JSON processing in 12.2 and above | dbms_json.prepAllJColInM; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.prepAllJColInM; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PREPJCOLINM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For JSON columns created prior to 12.2 upgrades the column to prepare to take advantage of in-memory JSON processing | dbms_json.prepJColInM( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TBD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PREPTABJCOLINM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For tables containing JSON columns created prior to 12.2 upgrades all JSON columns to to take advantage of in-memory JSON processing | dbms_json.prepTabJColInM(tabName IN VARCHAR2); |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.prepTabJColInM('PO'); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PRETTY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JSON Data guide formatting | dbns_json.pretty RETURN NUMBER PARALLEL ENABLE; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT dbms_json.pretty; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RENAME_COLUMN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set the preferred name for a view column or a virtual column creating using a dataguide. This has no effect when running on the shard catalog server. | dbms_json.rename_column( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exec dbms_json.rename_column('UWJSON', 'PO', '$.purchaseOrder.items.name', dbms_json.type_string, 'item_name'); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Related Topics |
| Built-in Functions |
| Built-in Packages |
| DBMS_JSON0 |
| DBMS_JSON_DUALITY |
| DBMS_JSON_INT |
| DBMS_JSON_SCHEMA |
| JSON Functionality |
| What's New In 21c |
| What's New In 26ai |
| This site is maintained by Daniel Morgan. Last Updated: | This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2026 Daniel A. Morgan All Rights Reserved | ||||||||
|
|
|||||||||