0

I tried to use variable in snowflake task, but I received an error. I read that task can contain only one statement and I think it can be a reason of failure - after variable setting the must be ';' - wchich means that there are at least two statements: variable declaration and main sql script. Or maybe I am missing somethin important in documentation?

Is there any way to place variable in Snowflake task? If not, what is the best workauround for that?

  • You can set session parameters [by altering the task](https://docs.snowflake.com/en/user-guide/tasks-intro.html#setting-session-parameters-for-tasks). – Christoph Oct 30 '20 at 14:26

1 Answers1

0

If you would like to use multiple statements in the snowflake task, I would suggest using a stored procedure in the task.

Currently, a task can execute a single SQL statement, including a call to a stored procedure.

https://docs.snowflake.com/en/user-guide/tasks-intro.html