SSC-FDM-OR0021
For Loop With Float Number As Bound May Not Behave Correctly In Snowflake Scripting
Description
Snowflake Scripting only allows an INTEGER
or an expression that evaluates to an INTEGER
as a bound for the FOR LOOP
condition. Floating numbers will be rounded up or down and alter the original bound.
The lower bound will be rounded to the closest integer number. For example:
3.1 -> 3, 6.7 -> 7, 4.5 -> 5
However the upper bound will be truncated to the closest lower integer. For example:
3.1 -> 3, 6.7 -> 6, 4.5 -> 4
Example Code
Input Code:
IN -> Oracle_01.sql
Output Code:
OUT -> Oracle_01.sql
Recommendations
Rewrite the FOR LOOP condition so it uses integers.
If you need more support, you can email us at snowconvert-support@snowflake.com
Last updated