Snowflake - How to get started with Snowflake in Automations
Note: we've recently (May 25th) released a new version of the Snowflake connector, if you had automations using Snowflake prior to that date, the connector will show as Snowflake - deprecated. To use this new version, simply replace those blocks with blocks from the current Snowflake connector.
This article gives an overview of the available blocks in the Snowflake connector in Qlik Application Automation. It will also go over some basic examples of retrieving data from a Snowflake database and creating a record in a database.
This connector has the following blocks:
List Tables: returns a list of the tables from the connected database.
List Records: returns a list of records from the specified table
Insert Record: create one record in the specified table.
Upsert Record: create or update one record in the specified table.
Insert Bulk: create multiple records in the specified table.
Upsert Bulk: create or update multiple records in the specified table.
Do Query: do a generic SQL query against the connected Snowflake database.
Update Record by One Field: update a single record in the specified table.
Delete Record: delete one record in the specified table.
List Schemas: returns a list of schemas from the connected database.
To create a new connection to Snowflake, the following parameters are required:
account_name -> your snowflake account/tenant name, 'ABC' if you Snowflake URL is abc.snowflakecomputing.com.
username -> username for the user that has remote access to the snowflake database.
password -> password used to authenticate the above username
dbname -> the name of the database you want to use for this connection. If you want to connect to multiple databases in the same automation, you'll need to create multiple connections.
warehouse -> the name of the warehouse you want to use for this connection.
Insert a new record into a table
Add the Insert Record block from the Snowflake connector to your automation.
Configure the block to point to a table in the database you're currently connected to, feel free to use the do lookup function for this.
Run the automation. This will insert a new record in your Snowflake table.
Use the Do Query block to create a new table
The Do Query block can be used to perform actions in Snowflake that aren't supported by the other blocks. See the below example on creating a new table.
Create a new automation
Search for the Snowflake connector in the left-hand side menu and find the Do Query block. Drag this block inside the automation. Highlight the Do Query block by clicking it and configure it in the right-hand side menu.
Add your query to create a new table in the Query input field. Here is a query example that creates a table:
Run the automation. This will create a new table with the specified structure within the selected database.
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.