SSC-EWI-RS0010
Out parameters not supported on top-level CALL unit.
Severity
Low
Description
Redshift allows the use of CALL statements within out parameters as top-level code units without defining a variable that would be assigned as output. Snowflake enforces the usage of a variable to set the output value somewhere.
Code Example
Input Code:
CREATE OR REPLACE PROCEDURE get_total_sales_by_product(
IN p_product_name VARCHAR(100),
OUT p_total_sales DECIMAL(18, 2)
)
AS $$
BEGIN
NULL;
END;
$$ LANGUAGE plpgsql;
CALL get_total_sales_by_product('Laptop');
Output Code:
CREATE OR REPLACE PROCEDURE get_total_sales_by_product (p_product_name VARCHAR(100), p_total_sales OUT DECIMAL(18, 2))
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": { "major": 0, "minor": 0, "patch": "0" }, "attributes": { "component": "redshift", "convertedOn": "07/10/2025", "domain": "no-domain-provided" }}'
AS $$
BEGIN
NULL;
END;
$$;
!!!RESOLVE EWI!!! /*** SSC-EWI-RS0010 - Top-level Procedure Call with out parameters is not supported. ***/!!!
CALL get_total_sales_by_product('Laptop');
Recommendations
Move the call into an anonymous block and declare a variable to pass as an output parameter.
If you need more support, you can email us at [email protected]
Last updated