Multiples IFs statement
Important Notice: Migration of Documentation Website
Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:
Official Snowflake Snowconvert Documentation
For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].
Thank you for your understanding.
This pattern defines a function that uses conditional statements over local variables.
Components:
Function Declaration:
CREATE FUNCTION functionName(parameters) RETURN returnTypeDeclares the function with input parameters and the return type.
Variable Declaration:
Declares variables, including the return variable.
BEGIN-END Block with IF Statement:
Check if a condition is true.
Each case is used to assign a value over the same variable.
Conversion:
DECLARE SECTION : variables with default an expression are moved to a common table expression.
IF/ELSE statement can be handled using the CASE EXPRESSION inside the select allowing conditionals inside the queries.
RETURN statement is transformed to the final select.
Known Issues
No issues were found.
Related EWIS
SSC-FDM-OR0042: Date Type Transformed To Timestamp Has A Different Behavior.
SSC-EWI-0073: Pending Functional Equivalence Review.
SSC-EWI-OR0036: Types resolution issues, the arithmetic operation may not behave correctly between string and date.
Last updated
