\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Jianmin Feng (taotao)} \pdfinfo{ /Title (oracle-12c-json-support.pdf) /Creator (Cheatography) /Author (Jianmin Feng (taotao)) /Subject (Oracle 12c Json Support Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{222FA8} \definecolor{LightBackground}{HTML}{F1F2F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Oracle 12c Json Support Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Jianmin Feng (taotao)} via \textcolor{DarkBackground}{\uline{cheatography.com/79308/cs/19440/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Jianmin Feng (taotao) \\ \uline{cheatography.com/taotao} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 22nd April, 2019.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{1.59264 cm} x{3.38436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Oracle Json support}} \tn % Row 0 \SetRowColor{LightBackground} before 12.1 & pljson package \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} apex 5.0 & apex\_json \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} 12.1 & native support \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} 12.2 & simpler, more functions \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Store JSON Documents}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{CREATE TABLE json\_doc ( \newline id RAW(16) NOT NULL, \newline data CLOB, \newline CONSTRAINT json\_doc\_pk PRIMARY KEY (id), \newline CONSTRAINT json\_doc\_json\_chk CHECK \newline (data IS JSON WITH UNIQUE KEYS(STRICT)) \newline ); \newline -{}-WITH UNIQUE KEYS: use care (performance) \newline -{}-(LAX): Lax syntax by default, (STRICT) = (case insensitive ," equals ' etc) \newline -{}-ORA- 02290: if constraint violated when insert \newline \newline INSERT INTO json\_doc (id, data) \newline VALUES (SYS\_GUID(), \newline '\{ \newline "FirstName" : "John", \newline "LastName" : "Doe", \newline "Job" : "Clerk", \newline "Address" : \{ \newline "Street" : "99 My Street", \newline "City" : "My City", \newline "Country" : "USA", \newline "Postcode" : "12345"\}, \newline "Phones" : {[}\{"Home":"123-456789"\}, \newline \{"Cell":"123-456789"\}{]}, \newline "DateOfBirth" : "01-JAN-1980", \newline "Active" : true \newline \}');} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{json stored in varchar2, clob; rarely in BLOB,NVARCHAR,NCLOB even supported} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Load Json by external table1}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{CREATE TABLE json\_doc\_ext(data clob) \newline ORGANI ZATION EXTERNAL \newline ( TYPE ORACLE \_LOADER \newline DEFAULT DIRECTORY ext\_dir \newline ACCESS PARAMETERS \newline ( records delimited by newline \newline fields terminated by 0X'09' \newline missing field values are null \newline badfile \seqsplit{ext\_dir:'json\_load.bad'} \newline logfile \seqsplit{ext\_dir:'json\_load.log'} \newline fields (data varchar2(5000) ) \newline ) \newline LOC ATION (ext\_dir: 'json\_file.txt') \newline ) REJECT LIMIT UNLIMITED; \newline \newline -{}-retrieve data \newline TRUNCATE TABLE json\_doc; \newline INSERT /{\emph{+ APPEND }}/ INTO json\_doc \newline SELECT SYS\_GUID(), json\_document \newline FROM json\_doc\_ext \newline WHERE data IS JSON; \newline COMMIT;} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Load Json by external table2}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{CREATE TABLE json\_docs\_ext \newline (id number, data clob) \newline ORGANI ZATION EXTERNAL \newline ( TYPE ORACLE \_LOADER \newline DEFAULT DIRECTORY ext\_dir \newline ACCESS PARAMETERS \newline ( records delimited by newline \newline fields terminated by 0X'09' \newline missing field values are null \newline ( id,fname ) \newline COLUMN TRANSFORMS ( \newline data FROM LOBFILE(f name) FROM (ext\_dir) ) \newline ) \newline LOC ATION (ext\_dir: 'json\_file\_list.txt') \newline ) REJECT LIMIT UNLIMITED; \newline \newline -{}-json\_file\_list.txt format \newline 1 file1.json \newline 2 file2.json \newline ... \newline -{}-retrieve data \newline TRUNCATE TABLE json\_docs; \newline INSERT /{\emph{+ APPEND }}/ INTO json\_doc \newline SELECT SYS\_GUID(), json\_document \newline FROM json\_docs\_ext \newline WHERE data IS JSON; \newline COMMIT;} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Querying Json Data - dot notation}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{SELECT a.data.FirstName, \newline a.data.LastName, \newline a.data.phones.home AS home\_phone, \newline a.data.phones.cell AS cell\_phone \newline FROM json\_doc a \newline WHERE \seqsplit{a.data.ContactDetails.Phone} IS NULL; \newline \newline -{}-table must be aliased \newline -{}-col must IS JSON \newline -{}-key is intensive by default (LAX)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Querying Json Data - JSON\_VALUE}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{SELECT JSON\_VALUE( \newline a.data, '\$.Phones' \newline RETURNING VARCHAR2(250) \newline ERROR ON ERROR \newline ) AS contact\_phones \newline FROM json\_documents a \newline ORDER BY 1; \newline \newline -{}-NULL ON ERROR (default) \newline -{}-ERROR ON ERROR \newline -{}-JSON\_VALUE returns scalar value, return complex values ( array, nested records) as null by default. \$.Phones is non scalar here \newline -{}-Supproted type: varchar2,number,date,timestamp,timestamp with time zone,sdo\_geometry, clob(18c),blob(18c) \newline -{}-default varchar2(4000)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Querying Json Data - JSON\_EXISTS}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{SELECT a.data.FirstName, \newline a.data.LastName, \newline a.data.Phones.cellAS cell\_hone \newline FROM json\_documents a \newline WHERE JSON\_EXISTS( a.data.Phones, \newline '\$.cell' FALSE ON ERROR) \newline \newline -{}-FALSE ON ERROR (default) \newline -{}-TRUE ON ERROR \newline -{}-ERROR ON ERROR} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Querying Json Data - JSON\_QUERY}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{SELECT a.data.FirstName,a.data.LastName, \newline JSON\_QUERY( \newline a.data, '\$.phones' \newline RETURNING VARCHAR2(1000) \newline WITH WRAPPER \newline ) AS contact\_Phones \newline FROM json\_documents a \newline ORDER BY a.data.FirstName, a.data.Last\_name; \newline \newline -{}-JSON\_QUERY could return multiple values \newline -{}-return type: varchar2(4000), clob(18c),blob(18c) \newline -{}-with wrapper: {[} \{....\} {]}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Querying Json Data - JSON\_TABLE}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{-{}-incoporates JSON\_VALUE,JSON\_EXISTS,JSON\_QUERY \newline CREATE OR REPLACE VIEW json\_doc\_v AS \newline SELECT row\_number, \newline jt.first\_name,jt.last\_name, \newline ,jt.addr\_city,jt.addr\_country, \newline TO\_DATE(jt.dob, 'DD-MON-YYYY') AS dob \newline FROM json\_doc, \newline JSON\_TABLE(data, '\$' COLUMNS ( \newline row\_num FOR ORDINA LITY, \newline first\_name varchar2(50) PATH '\$.FirstName', \newline last\_name varchar2(50) PATH '\$.LastName', \newline addr\_city varchar2(50 CHAR) \newline PATH '\$.Address.City', \newline addr\_country varchar2(50 CHAR) \newline PATH '\$.Address.Country', \newline dob varchar2(11) PATH '\$.DateOfBirth' \newline )) jt; \newline \newline -{}-NESTED (array) , Wrapper (nested records) \newline SELECT jt.first\_name,jt.last\_name, \newline jt.address.jt.phones \newline FROM json\_documents, \newline JSON\_TABLE(data, '\$' COLUMNS ( \newline first\_name varchar2(50) PATH '\$.FirstName', \newline last\_name varchar2(50) PATH '\$.LastName', \newline addres varchar2(4000) \newline FORMAT JSON WITH WRAPPER \newline PATH '\$.address', \newline NESTED PATH '\$.phones{[}*{]}' COLUMNS ( \newline home\_phone varchar2(12) PATH '\$.home', \newline cell\_phone varchar2(12) PATH '\$.cell', \newline ) \newline )) jt;} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{12.2 rewite JSON\_TABLE for fewer call to improve performance} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{JSON\_TEXTCONTAINS}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{1. create context/full text search index \newline -{}-12.1 \newline CREATE INDEX json\_search\_idx ON json\_doc(data) \newline INDEXTYPE IS CTXSYS.CONTEXT \newline PARAMETERS ('section group \newline \seqsplit{CTXSYS.JSON\_SECTION\_GROUP} SYNC (ON COMMIT)'); \newline -{}-12.2 \newline CREATE INDEX json\_search\_idx ON json\_doc(data) {\bf{FOR JSON}}; \newline \newline 2. collect stats \newline EXEC \seqsplit{DBMS\_STATS.gather\_table\_stats(user}, 'JSON\_DOC'); \newline \newline 3. query \newline SELECT COUNT({\emph{) FROM json\_doc \newline WHERE JSON\_TEXTCONTAINS( data, \newline '\$.phones.home', '123-456789'); \newline SELECT COUNT(}}) FROM json\_doc \newline WHERE JSON\_EXISTS( data, '\$.phones');} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.08574 cm} x{1.89126 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{FORMAT JSON clause}} \tn % Row 0 \SetRowColor{LightBackground} BLOB & explicit \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} CLOB,VARCHAR2 & implicit \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Dot Notation query Transformation}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{ALTER SESSION SET EVENTS '10053 trace name context forever'; \newline \newline SELECT a.data.FirstName, \newline a.data.LastName \newline FROM json\_documents a; \newline \newline ALTER SESSION SET EVENTS '10053 trace name context off'; \newline -{}-{}-{}-- \newline Final query after transformations:{\bf{ UNPARSED QUERY }} \newline SELECT \newline JSON\_QUERY("A"."DATA" FORMAT JSON , \newline '\$.FirstName' RETURNING VARCHAR2(4000) \newline ASIS WITHOUT ARRAY WRAPPER \newline NULL ON ERROR) "FIRSTNAME", \newline JSON\_QUERY("A"."DATA" FORMAT JSON , \newline '\$.LastName' RETURNING VARCHAR2(4000) \newline ASIS WITHOUT ARRAY WRAPPER \newline NULL ON ERROR) "LASTNAME" \newline FROM "TEST"."JSON\_DOCUMENTS" "A"} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Dot notation is automatically transformed to json\_query or json\_table for performance and index usage. It is good practice to avoid dot notion totally.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Identifying Columns Containing JSON}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{SELECT table\_name, \newline column\_name, \newline format, \newline data\_type \newline FROM user\_json\_columns; \newline -{}-\{USER|ALL|DBA\}\_JSON\_COLUMNS} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{SQL/JSON Generator functions}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{JSON\_OBJECT (KEY 'key\_val' VALUE t.col,....) \newline JSON\_OBJECTAGG (KEY t.col1 VALUE t.col2) \newline JSON\_ARRAY( \newline ROWNUM, \newline JSON\_OBJECT(KEY 'key\_val' VALUE t.col), \newline ... \newline ) \newline JSON\_ARRAYAGG(KEY t.col1 VALUE t.col2) \newline -{}- NULL ON NULL ( default) ABSENT ON NULL \newline -{}-RETURNING VARCHAR2(4000) by default \newline -{}-RETURNING VARCHAR2(32767) \newline -{}-CLOB(AGG function 12c, all for 18c), BLOB (18c) \newline -{}-FORMAT JSON required for BLOB only \newline -{}-TO\_CHAR(e.empno) to use number key \newline \newline SELECT JSON\_OBJECT ( \newline KEY 'departments' VALUE ( \newline SELECT JSON\_ARRAYAGG( \newline JSON\_OBJECT ( \newline KEY 'department\_name' VALUE d.dname, \newline KEY 'department\_no' VALUE d.deptno, \newline KEY 'employees' VALUE ( \newline SELECT JSON\_ARRAYAGG ( \newline JSON\_OBJECT( \newline KEY 'emp\_no' VALUE e.empno, \newline KEY 'emp\_name' VALUE e.ename)) \newline FROM emp e \newline WHERE e.deptno = d.deptno) \newline ))FROM dept d \newline )) AS departments \newline FROM dual;} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.93643 cm} x{2.04057 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Oracle 18c JSON support}} \tn % Row 0 \SetRowColor{LightBackground} JSON\_VALUE return & clob \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} JSON\_QUERY return & clob, blob \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} SQL/JSON type & clob, blob \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} JSON\_EQUAL Condition & new function \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} JSON\_TABLE & simpler syntax \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} SODA for PL/SQL & new function \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\seqsplit{https://oracle-base.com/articles/18c/json-support-in-oracle-database-18c}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{JSON\_EQUAL}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{-{}-compare independent of order and format \newline -{}-18c \newline \newline CREATE TABLE json\_equal\_tab ( \newline id NUMBER NOT NULL, \newline data1 VARCHAR2(50), \newline data2 VARCHAR2(50), \newline CONSTRAINT json\_equal\_tab\_pk PRIMARY KEY (id), \newline CONSTRAINT \seqsplit{json\_equal\_tab\_json1\_chk} \newline CHECK (data1 IS JSON), \newline CONSTRAINT \seqsplit{json\_equal\_tab\_json2\_chk} \newline CHECK (data2 IS JSON) \newline ); \newline -{}- Matching members, order and format. \newline INSERT INTO json\_equal\_tab VALUES (2, '\{"name1":"value1","name2":"value2"\}', '\{"name1":"value1","name2":"value2"\}'); \newline \newline -{}- Matching members/order, but differing format. \newline INSERT INTO json\_equal\_tab VALUES (3, '\{"name1":"value1","name2":"value2"\}', \newline '\{ "name1":"value1", "name2":"value2" \}'); \newline \newline -{}- Matching members, but differing order. \newline INSERT INTO json\_equal\_tab VALUES (4, '\{"name1":"value1","name2":"value2"\}', '\{"name2":"value2","name1":"value1"\}'); \newline \newline -{}-return 1 row \newline select {\emph{ \newline from json\_equal\_tab \newline where data1=data2; \newline -{}-return 3 rows \newline select }} \newline from json\_equal\_tab \newline where JSON\_EQUAL(data1, data2);} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Current JSON\_EQUAL only valid in where or case when clause, no native PL/SQL support yet.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}