Reference material for JSON_VALUE function
Takes a JSON document and extracts a JSON scalar value to SQL TEXT
value.
For JSON strings, removes the outermost quotes and unescapes the values.
Other JSON scalars are not changed.
Returns a SQL NULL
if a non-scalar value is given.
This function pairs with the JSON_EXTRACT function, which doesn’t convert the JSON values to SQL values.
Parameter | Description | Supported input types |
---|---|---|
<json> | The JSON document. | TEXT |
TEXT
NULL
the output is NULL
(propagates nulls).For the JSON document indicated by <json_common_example>
below,
see JSON common example. The returned result is based on this example.
Returns
'987654', '"987654"'
Example
Returns
123
Example
Returns
NULL
Example
Returns
NULL
Reference material for JSON_VALUE function
Takes a JSON document and extracts a JSON scalar value to SQL TEXT
value.
For JSON strings, removes the outermost quotes and unescapes the values.
Other JSON scalars are not changed.
Returns a SQL NULL
if a non-scalar value is given.
This function pairs with the JSON_EXTRACT function, which doesn’t convert the JSON values to SQL values.
Parameter | Description | Supported input types |
---|---|---|
<json> | The JSON document. | TEXT |
TEXT
NULL
the output is NULL
(propagates nulls).For the JSON document indicated by <json_common_example>
below,
see JSON common example. The returned result is based on this example.
Returns
'987654', '"987654"'
Example
Returns
123
Example
Returns
NULL
Example
Returns
NULL