This article is about the current transformation of the output parameters and how their functionality is being emulated.
Some parts in the output code are omitted for clarity reasons.
Description
An output parameter is a parameter whose value is passed out of the stored procedure, back to the calling statement. 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 -> Teradata_01.sql
CREATETABLEtable20 ( col1 NUMBER, col2 NUMBER );
OUT -> Teradata_01.sql
CREATE OR REPLACETABLEtable20 (col1 NUMBER(38, 18),col2 NUMBER(38, 18))COMMENT ='{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"teradata"}}';
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 called into another one, some statements are added to get and assign the value(s) to the respective argument(s).
As seen in the transformation, when retrieving the value from the called procedures, an implicit cast is performed from VARIANT to the type specified by the variable. Since there are a lot of possible data types, some casts may fail or contain different data.