TRY_PARSE_JSON

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

A special version of PARSE_JSON that returns a NULL value if an error occurs during parsing.

Syntax

supportedpartialnot supportednot scored

TRY_PARSE_JSON( <expr> [ , '<parameter>' ] )

Parameters

NameRequiredDescription
exprrequiredAn expression of string type (for example, VARCHAR) that holds valid JSON information.
'parameter'optionalString constant that specifies the parameter used to search for matches. Supported values: Parameter Description d Allow duplicate keys in JSON objects. If a JSON object contains a duplicate key, the returned object has a single instance of that key with the last value specified for that key. s Don’t allow duplicate keys in JSON objects (strict). This value is the default.ExpandShow lessSee more

Returns

Returns a value of type VARIANT that contains a JSON document. If the input is NULL or if an error occurs during parsing, the function returns NULL. This function doesn’t return a structured type.

Usage notes

Referenced by