SSC-EWI-PG0007
Into clause in Dynamic SQL is not support in Snowflake
Severity
Low
Description
PostgreSQL Dynamic SQL allows the INTO clause to store query results in variables. Snowflake does not support this functionality. Therefore, the INTO clause will be flagged with an EWI'.
Code Example
Input Code:
CREATE OR REPLACE PROCEDURE get_max_id(table_name VARCHAR, OUT max_id INTEGER)
AS $$
DECLARE
sql_statement VARCHAR;
BEGIN
sql_statement := 'SELECT MAX(id) FROM ' || table_name || ';';
EXECUTE sql_statement INTO max_id;
END;
$$ LANGUAGE plpgsql;Output Code:
Recommendations
If you need more support, you can email us at [email protected]
Last updated
