This article is about the current transformation of the output parameters and how their functionality is being emulated.
Description
An output parameter is a parameter whose value is passed out of the stored procedure/function module, back to the calling PL/SQL block. Since the output parameters are not supported by Snowflake Scripting, a solution has been implemented in order to emulate their functionality.
Sample Source Patterns
Sample auxiliary table
IN -> Oracle_01.sql
CREATETABLEtable01 (col1 NUMBER, col2 NUMBER);
OUT -> Oracle_01.sql
CREATE OR REPLACE TABLE table01 (col1 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/,
col2 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/)COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
;
In the declaration, the OUT or IN OUT keywords are removed. The assignment is being emitted the same as the input but to emulate the functionality of the output parameter some statements are being added.
When a procedure with output parameters is being called into another one, some statements are added in order to get and assign the value(s) to the respective argument(s).
Single out parameter
Oracle
IN -> Oracle_02.sql
-- Procedure with output parameter declarationCREATEORREPLACEPROCEDURE proc_with_single_output_parameters( param1 OUTNUMBER)ISBEGIN param1 :=123;END;-- Procedure with output parameter being calledCREATEORREPLACEPROCEDURE proc_calling_proc_with_single_output_parametersIS var1 NUMBER;BEGIN proc_with_single_output_parameters(var1);INSERT INTO TABLE01 VALUES(var1, -1);END;