Sqitch deploy of stored procedure with ampersand in code causes failure

200 Views Asked by At

The Sqitch deploy fails on a stored procedure script that is for snowflake and contains JavaScript code for the stored procedure which has a double ampersand (&&) in an IF...THEN conditional block. Sqitch thinks it is a variable and fails as far as I can tell.

Please advise how to treat ampersands (&) in comments or in the code of a stored procedure to get sqitch to ignore the &.

1

There are 1 best solutions below

0
Felipe Hoffa On

From the Snowflake docs:

To use an ampersand sign without using substitution, escape the ampersand sign with a second ampersand sign: &&variable

https://docs.snowflake.com/en/user-guide/snowsql-use.html

AFAIK, sqitch doesn't support variables, other than the ones native to the database:

https://groups.google.com/g/sqitch-users/c/zYuEYT44OgM/m/WglAw5eDCAAJ