CREATE PROCEDURE
Translation reference to convert Teradata CREATE PROCEDURE to Snowflake Scripting
Description
The Teradata CREATE PROCEDURE
and REPLACE PROCEDURE
statement generates or replaces a stored procedure implementation and compiles it.
For more information about CREATE PROCEDURE
or REPLACE PROCEDURE
click here.
Sample Source Patterns
Setup data
The following code is necessary to execute the sample patterns present in this section.
Basic Procedure
Teradata
Snowflake Scripting
Single out parameter
Teradata
Snowflake Scripting
Multiple out parameter
Teradata
Snowflake Scripting
Inside a procedure, the returned object can be easily deconstructed by using the following statements right after performing the procedure call:
LET call_results VARIANT := (SELECT * FROM TABLE(RESULT_SCAN(LAST_QUERY_ID())));
var1 := GET(:call_results, 'Message');
var2 := GET(:call_results, 'Message2');
\
Multiple out parameter with dynamic result sets
Teradata
Snowflake Scripting
Known Issues
1. Out Parameters
Snowflake Scripting does not support OUT/INOUT parameters therefore these parameters are returned at the end of the procedure's body.
2. SQL Data Access
By default, Snowflake procedures support the execution of any kind of SQL statements, including data reading or modification statements, making the SQL data access clause non-relevant. This clause will be ignored when converting the procedure.
3. Top Level Objects in Assessment Report
Elements (Temporal tables or Views) inside Stored Procedures are being counted in the Assessment report as Top Level Objects. The SnowConvert team is now working on a fix for this scenario.
Related EWIs
SSC-EWI-0073: Pending Functional Equivalence Review.
SSC-FDM-0020: Multiple result sets are returned in temporary tables.
Last updated