MSCEWI2073
Bash variables found, using SnowSQL with variable substitution enabled is required to run this script
This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.
Severity
Low
Description
When the source code of a script file migrated to Snowflake Scripting contains Bash variables placeholders ($variable or ${variable}), SnowConvert transforms them into SnowSQL variables (&variable or &{variable}).
This warning is generated to point out that the execution of the migrated script now depends on SnowSQL to work, please consider the following when running the script in SnowSQL:
Variable substitution must be enabled.
All variables must be defined.
Run the file as a batch script.
Example Code
Input Code:
.LOGON dbc, dbc;
select '$variable', '${variable}', '${variable}_concatenated';
select $colname from $tablename where info = $id;
select ${colname} from ${tablename} where info = ${id};
.LOGOFF;
Output Code:
EXECUTE IMMEDIATE
$$
--** MSC-WARNING - MSCEWI2073 - BASH VARIABLES FOUND, USING SNOWSQL WITH VARIABLE SUBSTITUTION ENABLED IS REQUIRED TO RUN THIS SCRIPT **
BEGIN
/*** MSC-ERROR - MSCEWI1037 - TRANSLATION FOR SCRIPT STATEMENTS IS PLANNED TO BE DELIVERED IN THE FUTURE ***/
/*.LOGON dbc, dbc;*/
SELECT
'&variable',
'&{variable}',
'&{variable}_concatenated';
SELECT
&colname
from
PUBLIC.&tablename
where
info = &id;
SELECT
&{colname}
from
PUBLIC.&{tablename}
where
info = &{id};
/*** MSC-ERROR - MSCEWI1037 - TRANSLATION FOR SCRIPT STATEMENTS IS PLANNED TO BE DELIVERED IN THE FUTURE ***/
/*.LOGOFF;*/
END
$$
Recommendations
If you need more support, you can email us at [email protected]
Last updated