Топ-100
 

JSON_VALID

RDBMS Type: MySQL
Topic

Syntax:
JSON_VALID(val)

Returns 0 or 1 to indicate whether a value is valid JSON. Returns NULL
if the argument is NULL.

URL: https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html

Example

mysql> SELECT JSON_VALID('{"a": 1}');
+------------------------+
| JSON_VALID('{"a": 1}') |
+------------------------+
| 1 |
+------------------------+
mysql> SELECT JSON_VALID('hello'), JSON_VALID('"hello"');
+---------------------+-----------------------+
| JSON_VALID('hello') | JSON_VALID('"hello"') |
+---------------------+-----------------------+
| 0 | 1 |
+---------------------+-----------------------+