15.10 - JSON_CHECK - Teradata Database

Teradata Database Teradata JSON

Product
Teradata Database
Release Number
15.10
Published
December 2015
Language
English (United States)
Last Update
2018-06-05
dita:mapPath
TeradataJSON_15_10.ditamap
dita:ditavalPath
ft:empty

Purpose

The JSON_CHECK function checks a string for valid JSON syntax and provides an informative error message about the cause of the syntax failure if the string is invalid.

Syntax



Syntax Elements

TD_SYSFNLIB
The name of the database where the function is located.
'{string}'
The string to be tested for compliance to JSON syntax.
CHAR, VARCHAR, and CLOB are the allowed input types.
LATIN and UNICODE are allowed for all data types.
A maximum of 8388096 UNICODE characters or 16776192 LATIN characters may be passed in for validation.

Return Value

  • 'OK', if the string is valid JSON syntax.
  • 'INVALID: error message', if the string is not valid JSON syntax. The error message provides an informative message about the cause of the syntax failure.
  • A Teradata NULL, if the input string is NULL.

Usage Notes

This function only tests data for compliance with JSON syntax. It does not create a JSON instance.

You can use this function to validate JSON data before loading it. This can save time when loading a large amount of JSON data by preventing the rollback of an entire transaction in the event of a JSON syntax error. The function also provides the necessary information to fix any syntax errors that may be present before you load the data.

You cannot use JSON_CHECK to validate JSON data that is stored in one of the binary formats. To validate BSON data, use the BSON_CHECK function.