MSCEWI2024

Abort statement is not supported due to an aggregate function.

Severity

Low

Description

This warning appears when an AGGREGATE function is part of an ABORT statement inside of a stored procedure. The statement is commented in this case because it is not supported in Snowflake.

Code Example

Input Code:

REPLACE PROCEDURE ABORT_SAMPLE()
BEGIN 
    ABORT WHERE SUM(TABLE1.COL1) < 2;
END;

Output Code:

CREATE OR REPLACE PROCEDURE PUBLIC.ABORT_SAMPLE ()
   RETURNS STRING
   LANGUAGE JAVASCRIPT
   EXECUTE AS CALLER
   AS
   $$
 	{
	   
	   /*** MSC-WARNING - MSCEWI2024 - ABORT STATEMENT IS NOT SUPPORTED DUE TO AN AGGREGATE FUNCTION ***/
	   /*        ABORT WHERE SUM(TABLE1.COL1) < 2*/
	   ;
	}
 
$$;

Recommendations