LOOP

Translation reference to convert Teradata LOOP statement to Snowflake Scripting

Description

Teradata's LOOP statement is translated to Snowflake Scripting LOOP syntax.

For more information on Teradata Loop, check here.

[label_name:] LOOP
    { sql_statement }
END LOOP [label_name];

Sample Source Patterns

Teradata

CREATE PROCEDURE loopProcedure(OUT resultCounter INTEGER)
BEGIN
    DECLARE counter INTEGER DEFAULT 0;
   
    customeLabel: LOOP 
    	SET counter = counter + 1;
	IF counter = 10 THEN
	    LEAVE customeLabel;
	END IF;
    END LOOP customeLabel;
   
    SET resultCounter = counter;
END;

CALL loopProcedure(:?);

Snowflake Scripting

Known Issues

No issues were found.

No related EWIs.

Last updated

Was this helpful?