Documente Academic
Documente Profesional
Documente Cultură
1
Oracle 18c Enhancements
Versions and Enhancements
SQL New features
It provides businesses of all sizes with access to the world’s fastest, most
scalable and reliable database technology for secure and cost-effective
deployment of transactional and analytical workloads in the Cloud, on-
premises and Hybrid Cloud configurations.
The Autonomous Data Warehouse Cloud for Data Warehouse, Data Mart,
Data Science, has been available in Oracle Cloud since March 2018.
Availability
Big Data and Data Warehousing
Database Overall
Diagnosability
Performance
RAC and Grid
Security
General
Graph
JSON
PL/SQL
Spatial
Text
You can specify that a given SQL expression returns JSON data, using TREAT
(... AS JSON).
SQL/JSON query and generation functions can return results as LOB data.
SQL/JSON generation functions can accept input in a variety of SQL data
types, and they can optionally be required to return well-formed JSON data.
In 6 digit sequence number: 3 digit instance offset number ||3 digit session
offset number ( 101 964)
Instance SID
1 1964
10234001
–
JSON: JavaScript Object Notation.
–
JSON is a syntax for storing and exchanging data.
–
JSON is text, written with JavaScript object notation.
–
JSON is a lightweight data-interchange format
–
JSON is "self-describing" and easy to understand
–
JSON is language independent *
* JSON uses JavaScript syntax, but the JSON format is text only.
Text can be read and used as a data format by any programming language.
JSON Syntax
Example
"name“ : "John“
JSON names require double quotes. JavaScript names don't.
JSON is text, and we can convert any JavaScript object into JSON, and send
JSON to the server.
We can also convert any JSON received from the server into JavaScript objects.
This way we can work with the data as JavaScript objects, with no complicated
parsing and translations.
Sending Data
If you have data stored in a JavaScript object, you can convert the object into
JSON, and send it to a server:
Its external text form is a string wrapped in square brackets with commas
separating the values.
The internal form is an object having get and opt methods for accessing the
values by index, and element methods for adding or replacing values.
The SQL/JSON function JSON_ARRAY takes as its input one or more SQL
expressions, converts each expression to a JSON value, and returns a JSON
array that contains those JSON values.
SELECT JSON_ARRAY (
JSON_OBJECT('percentage' VALUE .50),
JSON_ARRAY(1,2,3),
100,
'California',
null
NULL ON NULL
) "JSON Array Example"
FROM DUAL;
Example
SELECT JSON_OBJECT ('name' value 'Foo', 'Age' value 85) FROM DUAL
Output:
JSON_OBJECT('NAME'VALUE'FOO'FORMATJSON)
-------------------------------------------------
{"name":Foo}
SELECT JSON_OBJECT (
'deptno' VALUE d.department_id,
'deptname' VALUE d.department_name
) "Department Objects"
FROM hr.departments d where deptno is 10 STRICT
ORDER BY d.department_id;
PHONES
-------------------------------------------------------------------------------------
[{"type":"Office","number":"909-555-7307"},{"type":"Mobile","number":"415-555-
1234"}]