PREPARE
Translation specification to convert Teradata PREPARE statement to Snowflake Scripting. This section review the PREPARE pattern related to a cursor logic.
Description
Prepares the dynamic DECLARE CURSOR statement to allow the creation of different result sets. Allows dynamic parameter markers.
For more information, please review the following documentation.
Tedarata syntax:
Where:
statement_name is the same identifier as
statement_name
in a DECLARE CURSOR statement.statement_string is the SQL text that is to be executed dynamically.
statement_string_variable is the name of an SQL local variable, or an SQL parameter or string variable, that contains the SQL text string to be executed dynamically.
Important information
For this transformation, the cursors are renamed since they cannot be dynamically updated.
Sample Source Patterns
Data setting for examples
For this example, please use the following complementary queries in the case that you want to run each case.
Simple scenario
This example reviews the functionality for the cases where a single cursor is being used one single time.
Teradata
Snowflake Scripting
Usages for cursors must be renamed and declared again.