JSON_CHECK

Translation reference to convert the Teradata function JSON_CHECK to Snowflake Scripting.

Description

The JSON_CHECK function checks a string for valid JSON.

For more information regarding Teradata JSON_CHECK, check here.

[TD_SYSFNLIB.]JSON_CHECK(string_expr);

Sample Source Pattern

Basic Source Pattern

Teradata

IN -> Teradata_01.sql
SELECT JSON_CHECK('{"key": "value"}');

Snowflake Scripting

OUT -> Teradata_01.sql
SELECT
IFNULL(CHECK_JSON('{"key": "value"}'), 'OK');

JSON_CHECK inside CASE transformation

Teradata

IN -> Teradata_02.sql
SELECT CASE WHEN JSON_CHECK('{}') = 'OK' then 'OKK' ELSE 'NOT OK' END;

Snowflake Scripting

OUT -> Teradata_02.sql
SELECT
CASE
WHEN IFNULL(CHECK_JSON('{}'), 'OK') = 'OK'
THEN 'OKK' ELSE 'NOT OK'
END;

Known Issues

No issues were found.

No related EWIs.

Last updated