March 2018
Intermediate to advanced
816 pages
19h 35m
English
To validate JSON, you can use the ISJSON function. This is a scalar function and checks whether the input string is valid JSON data. The function has one input argument:
The return type of the function is int, but only three values are possible:
The following statement checks whether the input variable is JSON valid:
SELECT
ISJSON ('test'),
ISJSON (''),
ISJSON ('{}'),
ISJSON ('{"a"}'),
ISJSON ('{"a":1}'),
ISJSON ('{"a":1"}');
Here is the output:
------ ------ ------ ------ ------ ------ 0 0 1 0 1 0
ISJSON does ...
Read now
Unlock full access