DBA Hub

📋Steps in this guide1/8

JSON Support Enhancements in Oracle Database 12c Release 2 (12.2)

Oracle 12c Release 2 (12.2) includes several enhancements to the JSON functionality in the database. This article details some of them, as well as linking to separate articles on others.

oracle 12cconfigurationintermediate
by OracleDba
13 views
1

JSON Developers Guide

The documentation for Oracle Database 12c Release 2 (12.2) now includes a new manual, which brings together all the support for JSON inside the database. - JSON Developer's Guide
2

The JSON conditions and functions from 12.1 are now supported in PL/SQL

Oracle Database 12c Release 1(12.1) introduced a number of JSON conditions and functions available from SQL. Oracle Database 12c Release 2 (12.2) now supports these conditions and functions in PL/SQL also. The following example shows the and conditions and the and functions used in PL/SQL. The following article explains these conditions and functions in more depth.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SET SERVEROUTPUT ON
DECLARE
  PROCEDURE test_json (p_json IN CLOB) IS
  BEGIN
    IF p_json
IS JSON
THEN
      DBMS_OUTPUT.put_line(p_json || ' - IS JSON');
      IF
JSON_EXISTS(p_json, '$.employee_no' FALSE ON ERROR)
THEN
        DBMS_OUTPUT.put_line('employee_no = ' ||
JSON_VALUE(p_json, '$.employee_no')
);
        DBMS_OUTPUT.put_line('employee_no = ' ||
JSON_QUERY(p_json, '$.employee_no' WITH CONDITIONAL WRAPPER)
);
      END IF;
    ELSE
      DBMS_OUTPUT.put_line(p_json || ' - IS NOT JSON');
    END IF;
  END;
BEGIN
  test_json('banana');
  test_json('{ "employee_no":9999 }');
END;
/
banana - IS NOT JSON
{ "employee_no":9999 } - IS JSON
employee_no = 9999
employee_no = [9999]

PL/SQL procedure successfully completed.

SQL>
3

SQL/JSON Functions

Oracle Database 12c Release 2 (12.2) includes new SQL/JSON functions to generate JSON data directly from SQL. You can read more about this in the following article.
4

PL/SQL Object Types for JSON

Oracle Database 12c Release 2 (12.2) includes new JSON object types to support the in-memory parsing, generation and update of JSON data directly from PL/SQL. You can read more about this in the following article.
5

Rewrites to JSON_TABLE

In Oracle 12.2 multiple calls to , , and may be rewritten to fewer calls to improve performance.
6

Simplified Syntax for JSON Search Indexes

A new simplified JSON search index syntax has been introduced in Oracle Database 12.2. There are no differences in the way the resulting JSON search index performs.
7

JSON Data Guide

Simplify the interaction with JSON data stored in the database using the JSON Data Guide functionality introduced in Oracle Database 12c Release 2 (12.2).
8

{USER|ALL|DBA}_JSON_COLUMNS Views

The views display the table columns containing JSON data, that is table columns with an check constraint. In 18c these views also list view columns that contain JSON data. For more information see: Hope this helps. Regards Tim...

Comments (0)

Please to add comments

No comments yet. Be the first to comment!