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:
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
