DECLARE

Translation reference to convert Teradata DECLARE statement to Snowflake Scripting

Description

Declares one or more local variables.

For more information regarding Teradata DECLARE, check here.

DECLARE variable_name [, variable_name ]... DATA_TYPE [ DEFAULT default_value]

Sample Source Patterns

Teradata

IN -> Teradata_01.sql
CREATE PROCEDURE declareExample ( )
BEGIN
    DECLARE COL_NAME, COL_TYPE VARCHAR(200) DEFAULT '' ;
    DECLARE COL_COUNT, COL_LEN INTEGER;
END;

Snowflake Scripting

OUT -> Teradata_01.sql
CREATE OR REPLACE PROCEDURE declareExample ( )
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "teradata",  "convertedOn": "06/18/2024" }}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        COL_NAME VARCHAR(200) DEFAULT '';
        COL_TYPE VARCHAR(200) DEFAULT '';
        COL_COUNT INTEGER;
        COL_LEN INTEGER;
    BEGIN
         
         
        RETURN 1;
    END;
$$;

Known Issues

No issues were found.

No related EWIs.

Last updated