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:
PREPARE statement_name FROM { 'statement_string' | statement_string_variable } ;Where:
statement_name is the same identifier as
statement_namein 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.
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
1
Snowflake Scripting
1
Simple scenario with RETURN ONLY
Teradata
1
Snowflake Scripting
1
Reused cursor case
Teradata
Snowflake Scripting
Modified query before usage
Teradata
1
Snowflake Scripting
1
Simple cursor combined with no PREPARE pattern
Teradata
1
Snowflake Scripting
1
Prepare combined with nested cursors
Teradata
Snowflake Scripting
Variable markers without variable reordering
This case is not supported yet.
Teradata
ok
Snowflake Scripting
ok
Variable markers with variable reordering
This case is not supported yet.
Teradata
Snowflake Scripting
Anonymous blocks - Declaration outside the block
This case is not supported yet.
Teradata
Known Issues
Review carefully nested cursors and conditionals, if that is the case.
Related EWIs
No related EWIs.
Last updated
