How to Create View Dynamically in Snowflake?

The best part about Snowflake is that it supports almost all features that are available in any modern data warehouse. One of such a feature is dynamic SQL. You can execute SQL statements dynamically using Snowflake stored procedures. Snowflake supports JavaScript API to write stored procedures and user-defined functions. Note that, there is a difference between Snowflake stored procedure and UDFs. We will use stored procedures to create a view dynamically in Snowflake. Create View Dynamically in Snowflake In a data warehouse application, you will always get requirement to write…

Continue ReadingHow to Create View Dynamically in Snowflake?
Comments Off on How to Create View Dynamically in Snowflake?

Redshift Dynamic SQL Queries and Examples

When you are working on the various data sources and different kind of SQL queries, there may be situations where you want to generate dynamic SQL queries dynamically based on your requirement. In Redshift you can PREPARE SQL statement and EXECUTE it. Redshift also support use of EXECUTE command in Redshift stored procedures. In this article, we will check Redshift Dynamic SQL Queries, how to PREPARE them and run using EXECUTE statements. The dynamic SQL in Redshift can be useful in many scenarios, such as when you need to execute…

Continue ReadingRedshift Dynamic SQL Queries and Examples
Comments Off on Redshift Dynamic SQL Queries and Examples