MSCEWI4045

Labeled Statement is not supported in Snowflake Scripting.

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

Low

Description

This EWI is added for all the LABELS used with the GOTO statement in SQL Server.

Code Example

Input Code:

CREATE PROCEDURE GoToProcedure
AS
BEGIN
DECLARE @TotalMaarks INT
SET @TotalMaarks = 49
IF @TotalMaarks >= 50
    GOTO Pass
IF @TotalMaarks < 50
    GOTO Fail
Pass:
    SELECT 1;
    SELECT * FROM TABLE1;
    RETURN 1;
Fail:
    SELECT 2;
    SELECT * FROM TABLE2;
    RETURN 2;
END

Output Code:

CREATE OR REPLACE PROCEDURE PUBLIC.GoToProcedure ()
RETURNS VARCHAR
LANGUAGE SQL
EXECUTE AS CALLER
AS
$$
   DECLARE
      TOTALMAARKS INT;
   BEGIN
       
      TOTALMAARKS := 49
      IF (TOTALMAARKS >= 50) THEN
-- ** MSC-ERROR - MSCEWI1037 - TRANSLATION FOR GOTO IS PLANNED TO BE DELIVERED IN THE FUTURE **
--         GOTO Pass
      END IF;
      IF (TOTALMAARKS < 50) THEN
-- ** MSC-ERROR - MSCEWI1037 - TRANSLATION FOR GOTO IS PLANNED TO BE DELIVERED IN THE FUTURE **
--         GOTO Fail
      END IF;
-- ** MSC-WARNING - MSCEWI4045 - LABELED STATEMENT IS NOT SUPPORTED IN SNOWFLAKE SCRIPTING **
--      Pass:
      SELECT 1;
      SELECT * FROM PUBLIC.TABLE1;
      RETURN 1;

-- ** MSC-WARNING - MSCEWI4045 - LABELED STATEMENT IS NOT SUPPORTED IN SNOWFLAKE SCRIPTING **
--      Fail:
      SELECT 2;
      SELECT * FROM PUBLIC.TABLE2;
      RETURN 2;

   END;
$$;

Recommendations

Last updated