

JS Web APIs Web API Intro Web Forms API Web History API Web Storage API Web Worker API Web Fetch API Web Geolocation API JS Browser BOM JS Window JS Screen JS Location JS History JS Navigator JS Popup Alert JS Timing JS Cookies JS HTML DOM DOM Intro DOM Methods DOM Document DOM Elements DOM HTML DOM Forms DOM CSS DOM Animations DOM Events DOM Event Listener DOM Navigation DOM Nodes DOM Collections DOM Node Lists JS Async JS Callbacks JS Asynchronous JS Promises JS Async/Await JS Classes Class Intro Class Inheritance Class Static JS Functions Function Definitions Function Parameters Function Invocation Function Call Function Apply Function Bind Function Closures JS Objects Object Definitions Object Properties Object Methods Object Display Object Accessors Object Constructors Object Prototypes Object Iterables Object Sets Object Maps Object Reference type.JS Tutorial JS HOME JS Introduction JS Where To JS Output JS Statements JS Syntax JS Comments JS Variables JS Let JS Const JS Operators JS Arithmetic JS Assignment JS Data Types JS Functions JS Objects JS Events JS Strings JS String Methods JS String Search JS String Templates JS Numbers JS BigInt JS Number Methods JS Number Properties JS Arrays JS Array Methods JS Array Sort JS Array Iteration JS Array Const JS Dates JS Date Formats JS Date Get Methods JS Date Set Methods JS Math JS Random JS Booleans JS Comparisons JS If Else JS Switch JS Loop For JS Loop For In JS Loop For Of JS Loop While JS Break JS Iterables JS Sets JS Maps JS Typeof JS Type Conversion JS Bitwise JS RegExp JS Precedence JS Errors JS Scope JS Hoisting JS Strict Mode JS this Keyword JS Arrow Function JS Classes JS Modules JS JSON JS Debugging JS Style Guide JS Best Practices JS Mistakes JS Performance JS Reserved Words Because of SQL/JSON path-expression syntax relaxation.

Note that if path expression $. were used in Example 19-1 it would give the same result. For the document in Example 4-2 the phone types are "Office" and "Mobile", and the array returned is either or. For each document it returns a VARCHAR2 value whose contents represent a JSON array with elements the phone types, in an unspecified order. The error clause for json_query can specify EMPTY ON ERROR, which means that an empty array ( ) is returned in case of error (no error is raised).Įxample 19-1 shows an example of the use of SQL/JSON function json_query with an array wrapper. The wrapper clause determines the form of the returned string value. Keywords FORMAT JSON are not needed (or available) for json_query - JSON formatting is implicit for the return value. For example, an ASCII TAB character (Unicode character CHARACTER TABULATION, U+0009) is escaped as \t. This includes ensuring that non-ASCII characters in string values are escaped as needed. ( VARCHAR2 is the default.) The value returned always contains well-formed JSON data. A BLOB result is in the A元2UTF8 character set. In the RETURNING clause you can specify data type VARCHAR2, CLOB, or BLOB. The path expression can target any number of JSON values. The second argument to json_query is a SQL/JSON path expression followed by optional clauses RETURNING, WRAPPER, ON ERROR, and ON EMPTY. The result of evaluating the SQL expression is used as the context item for evaluating the path expression. It can be a table or view column value, a PL/SQL variable, or a bind variable with proper casting. It can be of data type VARCHAR2, CLOB, or BLOB. The first argument to json_query is a SQL expression that returns an instance of a scalar SQL data type (that is, not an object or collection data type).
