Auto-Generated code in order to support output parameters in Snowflake Scripting
This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.
Severity
Low
Description
This warning is used to inform that some statements are being added to the procedures with output parameters in order to emulate their functionality. The auto-generated code is being added in the procedure with the output parameters and also where this procedure is being called.
Example Code
Input
CREATE OR REPLACE PROCEDURE proc_with_output_parameters(param1 OUT NUMBER, param2 IN OUT NUMBER)ISBEGINparam1 :=123;param2 :=456;END;CREATE OR REPLACE PROCEDURE proc_calling_proc_with_output_parametersISvar1 NUMBER;var2 NUMBER;BEGINproc_with_output_parameters(var1, var2);END;
Output
CREATE OR REPLACE PROCEDURE PUBLIC.proc_with_output_parameters (param1 NUMBER (38,18) /*** MSC-WARNING - MSCEWI1083 - OUTPUT PARAMETERS ARE NOT SUPPORTED BUT FUNCTIONALITY IS BEING EMULATED ***/, param2 NUMBER (38,18) /*** MSC-WARNING - MSCEWI1083 - OUTPUT PARAMETERS ARE NOT SUPPORTED BUT FUNCTIONALITY IS BEING EMULATED ***/)RETURNS TABLE(param1 NUMBER (38,18),param2 NUMBER (38,18))LANGUAGE SQLEXECUTE AS CALLERAS$$BEGINparam1 :=123;param2 :=456;/*** MSC-WARNING - MSCEWI1082 - AUTO-GENERATED CODE IN ORDER TO SUPPORT OUT PARAMETERS IN SNOWFLAKE SCRIPTING ***/LET outParametersResultSet RESULTSET :=(SELECT:param1,:param2);RETURN TABLE(outParametersResultSet);END;$$;CREATE OR REPLACE PROCEDURE PUBLIC.proc_calling_proc_with_output_parameters ()RETURNS VARCHARLANGUAGE SQLEXECUTE AS CALLERAS$$DECLAREvar1 NUMBER (38,18);var2 NUMBER (38,18);BEGINCALL PUBLIC.proc_with_output_parameters(:var1, :var2);/*** MSC-WARNING - MSCEWI1082 - AUTO-GENERATED CODE IN ORDER TO SUPPORT OUT PARAMETERS IN SNOWFLAKE SCRIPTING ***/LET call_results VARIANT;SELECTOBJECT_CONSTRUCT(*)INTOcall_resultsFROMTABLE(RESULT_SCAN(LAST_QUERY_ID()));var1 := GET(:call_results, ':PARAM1::NUMBER(38,18)');var2 := GET(:call_results, ':PARAM2::NUMBER(38,18)');END;$$;