SQLite JSON_VALID() Function
Example
Check two texts. Names in JSON must be in double quotes, so the second text is not valid:
SELECT JSON_VALID('{"a": 1}'),
JSON_VALID('{a: 1}');
Try it Yourself »
Definition and Usage
The JSON_VALID() function returns 1 if a text is valid JSON, and 0 if it is not.
Note: Read more about JSON in the SQLite JSON chapter.
Tip: Also look at JSON().
Syntax
JSON_VALID(json)
Parameter Values
| Parameter | Description |
|---|---|
| json | Required. The text to check |
Technical Details
| Return type: | Integer |
|---|