Initializes the value of a session variable to the result of a SQL expression.
SET <var> = <expr> SET ( <var> [ , <var> ... ] ) = ( <expr> [ , <expr> ... ] )
Specifies the identifier for the variable to initialize.
Specifies the SQL expression for the variable.
The command supports setting multiple variables in the same statement.
If the command executing complex expressions, it might require a running virtual warehouse in the session.
The number of expressions must match the number of variables to initialize.
The size of string or binary variables is limited to 256 bytes.
The identifier (i.e. name) for a SQL variable is limited to 256 characters.
Variable names such as
PUBLICare reserved for future use by Snowflake and cannot be used.
SET V1 = 10; SET V2 = 'example'; SET (V1, V2) = (10, 'example');