How to pull (retrieve) data from an AWS Snowflake database into Statistica for analytical processing

How to pull (retrieve) data from an AWS Snowflake database into Statistica for analytical processing

book

Article ID: KB0070325

calendar_today

Updated On:

Products Versions
Spotfire Statistica 14.0.0 and Higher

Description

The procedure shown here consists steps for establishing the connection between Statistica and Snowflake by using ODBC Driver.

Prerequisites :

The Snowflake ODBC Driver/client needs to be installed as a pre-requisite to connect to the database.
If you haven’t already downloaded the latest driver version, download it now. Here are the links below for the Snowflake ODBC Driver :  Snowflake supports ODBC connections and hence requires the user to create an ODBC DSN first.

Issue/Introduction

This articles gives step by step guside on establishing the connectiona and pulling data into Statistica from AWS Snowflake.

Environment

Windows Operating Systems

Resolution


To configure the ODBC driver in a Windows environment, create a DSN for the driver:

Step 1: Launch the Windows Data Source Administration Tool:

Search on your Windows machine for the launcher for the ODBC Data Source Administration Tool. Once you find the ODBC administration tool, click on the tool to launch it and display the setup window.

Step 2: Verify that the Snowflake ODBC driver is installed:
Navigate to the  Drivers tab in the setup window and verify that the driver (SnowflakeDSIIDriver) appears:

User-added image

If you do not see  SnowflakeDSIIDriver, then the Snowflake ODBC driver installation did not complete successfully and you need to re-install it.

Step 3: Create a new DSN:
  1. Navigate to the User DSN or System DSN tab and click the Add button.
  2. Select SnowflakeDSIIDriver from the list of installed drivers.
  3. Enter the connection parameters for the driver.
  4. In the fields provided in the Snowflake Configuration dialog, enter the parameters for the DSN:
User-added image

When entering parameters, note the following:
  • Data SourceUser, Password, and Server are the only parameters required to create a DSN.
  • All other parameters in the dialog are optional. In particular, the proxy-related parameters should be specified only if you are using a proxy, and the Authenticator should be changed from the default (“snowflake”) only if needed. 


To configure Database connection within Statistica (or Enterprise Manager) -

Step 1: Create a new database connection. From the Statistica desktop, the user may choose File >> External Data >>Query >> Create (Within Enterprise Manager you may right-click on New Database connection). In the Data Link properties dialog the user should choose "Microsoft OLEDB Provider for ODBC":

User-added image


Step 2: Choose the DSN that was created in Step - 3 (Create a new DSN) and enter credentials as required. You can optionally test the connection to ensure the details are correct. (In Enterprise Manager, commit the change to Save):

User-added image


Step 3: Name the connection for future connections (Once a connection is defined, there is no need to re-define the connection every time you connect to the same database. A user may connect to any defined database connection by picking the connection from a list of database connections):

User-added image

Step 4: On Statistica desktop, you may define the query with the Query window that launches. In Enterprise Manager, right-click on a folder and click "New Data Configuration" pick the database connection created in the above step, and click on Query Builder. Define the SQL query by dragging and dropping tables into the right-hand frame. ( the user may alternatively type the SQL statement instead of using the query builder). Click on the green triangular play button to finalize the query. (In Enterprise Manager, click on the commit button to save).

Step 5: Bring the data back into a spreadsheet. In Enterprise Manager, you would need to click on the Explore button in the data configuration created to bring the data into a spreadsheet:

User-added image
 

Additional Information