MSC-BQ0016
Session variable assignment of complex datatype is not supported in Snowflake
Severity
Description
Example code
Input Code:
CREATE TABLE test.JsonTable
(
col1 JSON
);
DECLARE myVar1 JSON DEFAULT JSON'{"name": "John", "age": 30}';
INSERT INTO test.JsonTable VALUES (myVar1);
BEGIN
DECLARE myVar2 JSON DEFAULT JSON'{"name": "Mike", "age": 27}';
INSERT INTO test.JsonTable VALUES (myVar2);
END;
SELECT col1 FROM test.JsonTable;Output Code:
Recommendations
Last updated
