ARGUMENTS MODE
Description
Amazon Redshift stored procedures support parameters that can be passed during procedure invocation. These parameters allow you to provide input values, retrieve output values, or use them for input and output operations. Below is a detailed explanation of the types of parameters, their modes, and examples of their usage. Snowflake only supports input values.
IN (Input Parameters)
Purpose: Used to pass values into the procedure.
Default Mode: If no mode is specified, parameters are considered IN.
Behavior: Values passed to the procedure cannot be modified inside the procedure.
OUT (Output Parameters)
Purpose: Used to return values from the procedure.
Behavior: Parameters can be modified inside the procedure and are returned to the caller. You cannot send an initial value.
INOUT (Input/Output Parameters)
Purpose: Used to pass values into the procedure and modify them to return updated values.
Behavior: Combines the behavior of IN and OUT. You must send an initial value regardless of the output.
Grammar Syntax
[ argname ] [ argmode ] argtype
Sample Source Patterns
Input Code:
CREATE OR REPLACE PROCEDURE SP_PARAMS(
IN PARAM1 INTEGER,
OUT PARAM2 INTEGER,
INOUT PARAM3 INTEGER)
AS
$$
BEGIN
NULL;
END;
$$
LANGUAGE plpgsql;
Output Code:
CREATE OR REPLACE PROCEDURE SP_PARAMS (PARAM1 INTEGER, PARAM2 OUT INTEGER, PARAM3 OUT INTEGER)
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;
$$;
Known Issues
There are no known issues.
Related EWIs
SCC-EWI-0028 : Type not supported by Snowflake.
SSC-EWI-RS0010: Top-level procedure call with out parameters is not supported.
Last updated