How to query data from Amazon Redshift into Statistica /Statistica Enterprise for analyses using PostGres ODBC Driver?

How to query data from Amazon Redshift into Statistica /Statistica Enterprise for analyses using PostGres ODBC Driver?

book

Article ID: KB0078681

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.0 and higher

Description

PREREQUISITES: 

1. Details to connect to Amazon Redshift Server - Server,Port and credentials
2. PostGres ODBC driver 9.x or higher

3. Ensure that the IP address of the machine is added to the AWS Security group.

Issue/Introduction

How to query data from Amazon Redshift into Statistica /Statistica Enterprise for analyses using PostGres ODBC Driver?

Resolution

1. Launch Control Panel >> System and Security >> Administrative Tools >> ODBC Data Sources >> System DSN tab ( a simpler alternative to get there is: Click Start button -> type "ODBC" -> Windows Search finds the "ODBC Data Sources" administrative module, click on it to run ) .Click on the Add button.

2. Pick PostGresSQL Unicode(x64) driver (This should appear if Postgres ODBC driver has been installed.

3.  Enter Redshift Server and database credentials as shown below. Optionally click on "Test" button to ensure that the database credentials entered were correct.

User-added image

4. Login to Statistica or Statistica Enterprise Manager.
     - If you are logging into Statistica Enterprise Manager ensure you login as a user with Database Admin and Data Admin permissions.


5. If using Statistica desktop, the user may choose File >> External Data >>Query >> Create.  Click on New OLEDB...
    -
If using Enterprise Manager, you may right-click on Database connections and select "New OLEDB Database connection".

6. In the Data Link properties dialog the user should choose "Microsoft OLEDB Provider for ODBC" and select Next.

7. 
Choose the DSN that was created in Step 3 and enter credentials as required. You may optionally test the connection to ensure the connection details are correct and name the connection appropriately. In Enterprise Manager, commit the change to Save

User-added image
8. If using Statistica Enterprise Manager, name the connection as you would like and define Access define access permissions for users who will access the connection. If using Statistica, skip to step 10.

9. If using Statistica Enterprise Manager, right click on a folder and click "New Data Configuration" and pick the database connection created. Click on New button in the Queries section and then click on Query Builder.  
  User-added image
      
10. 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.

User-added image

11. In Enterprise Manager, click on the commit button to save the data configuration (define access permissions as deemed necessary).  Explore the data configuration created to bring the data into a spreadsheet. In Statistica, clicking on the green triangular button as illustrated above should bring data into a new spreadsheet or existing spreadsheet as chosen by the user. 


 

Additional Information

https://docs.aws.amazon.com/redshift/latest/dg/c_redshift-postgres-jdbc.html

Note : For the purpose of this article, Statistica Enterprise Manager was used for illustrations. If using Statitica for the query, refer to linked article for illustrations of Statistica desktop with similar procedure described in this article