JSON Values

JSON_VALUE

Parses JSON elements like an array, string, number, boolean, null which are not enclosed in a JSON object. This is perfectly valid and allowed by JSON Grammar).

output type:

VARIANT (default) or explicitly selected conversion type

quantifier:

none

configuration:

charset = character set name enclosed in single or double quotes (for example charset="ISO-8859-1")

locale = string specifying IETF BCP 47 language tag enclosed in single or double quotes (see the list here ). The default locale is English.

typed = Boolean value, allowing to control JSON_VALUE output type: “false” sets the output to VARIANT type, “true” sets output directly to explicitly selected conversion type. Effective only when used with the explicit conversion.

strict = Boolean value. “false” allows parsing arrays not following JSON specification. Unquoted JSON names and string values consisting of one word can be parsed. Default is “true”. See Parsing non-standard JSON objects.

maxlen = numeric value representing the maximum byte size of an array. Allows parsing large JSON arrays (exceeding default size of 128000 bytes).

Example 37. Here we have two JSON values in separate lines: a number and a string.

33
"::1"

The number on line 1 is parsed automatically. The string on line 2 is explicitly converted to IPADDR:

1
JSON_VALUE{}:auto EOL JSON_VALUE{IPADDR}:ip

Here’s the result (double-click on the resultset row to see the details):

name value type
auto 33 VARIABLE<LONG
ip ::1 IPADDR