CASE

Translation reference for CASE statements

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.

Description

The CASE statement chooses from a sequence of conditions and runs a corresponding statement. For more information regarding Oracle CASE, check here.

Some parts in the output code are omitted for clarity reasons.

Simple case

[ <<label>> ] CASE case_operand
  WHEN boolean_expression THEN statement ;
  [ WHEN boolean_expression THEN statement ; ]...
  [ ELSE statement [ statement ]... ;
END CASE [ label ] ;
CASE ( <expression_to_match> )
    WHEN <expression> THEN
        <statement>;
        [ <statement>; ... ]
    [ WHEN ... ]
    [ ELSE
        <statement>;
        [ <statement>; ... ]
    ]
END [ CASE ] ;

Searched case

Sample Source Patterns

Sample auxiliar table

Simple Case

Oracle

Snowflake Scripting

Searched Case

Oracle

Snowflake Scripting

Known issues

1. Labels are not supported in Snowflake Scripting CASE syntax

The labels are commented out or removed depending on their position.

  1. SSC-EWI-0094: Label declaration not supported.

  2. SSC-FDM-0007: Element with missing dependencies.

Last updated