Multiples IFs statement
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
