SET

Translation reference to convert Teradata SET statement to Snowflake Scripting

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

Description

Assigns a value to a local variable or parameter in a stored procedure.

For more information regarding Teradata SET, check here.

SET assigment_target = assigment_source ;

Sample Source Patterns

Teradata

IN -> Teradata_01.sql
CREATE PROCEDURE setExample ( OUT PARAM1 INTEGER )
BEGIN
    DECLARE COL_COUNT INTEGER;
    SET COL_COUNT = 3;
    SET PARAM1 = COL_COUNT + 1;
END;

Snowflake Scripting

OUT -> Teradata_01.sql
CREATE OR REPLACE PROCEDURE setExample (
--                                         OUT
                                             PARAM1 INTEGER )
RETURNS VARIANT
LANGUAGE SQL
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "teradata",  "convertedOn": "07/24/2024" }}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        COL_COUNT INTEGER;
    BEGIN
         
        COL_COUNT := 3;
        PARAM1 := COL_COUNT + 1;
        RETURN PARAM1;
    END;
$$;

Known Issues

No issues were found.

No related EWIs.

Last updated