How to connect to SAP HANA from Statistica using ODBC driver

How to connect to SAP HANA from Statistica using ODBC driver

book

Article ID: KB0082289

calendar_today

Updated On:

Products Versions
Spotfire Statistica -

Description

For the purpose of this article, Statistica Enterprise Manager is used. Similar connectivity can be established via File  >> External Data >> Query >> Create within Statistica

PREREQUISITES:
1.In addition to the Statistica installation, SAP HANA client must be downloaded and installed 
2. In context of using Statistica Enterprise Manager, the user should have permissions to create a database connection - Either System Admin (SADM) or Database Admin (EXTDB_ADM) and Data Admin (DADM)
3. Details of SAP HANA server, Port and user credentials.

 

Issue/Introduction

This article details how to connect to SAP HANA from Staistica/ Statistica Enterprise manager using the ODBC Provider

Resolution

 To use the ODBC driver and define a SQL statement to retrieve data from SAP HANA :

1. Launch Control Panel >> System And Security>> Administrative Tools >> ODBC Data Sources. 
2. Define either a System DSN or a USER DSN by choosing a tab of your choice, and click on the Add button.
3. Choose the driver as : HDBODBC and then click Finish. (Contact System administrator, if you do not see the aforementioned driver - it likely implies that SAP HANA client is not installed ) 
      
      User-added image

4. Enter the Server and Port details and click on Connect. 
       
       User-added image
5.  Type the User and password details to connect to the server and click OK. The "Connect Successful" message indicates that the credentials are correct. If this success message is not seen, contact your system administrator for the right credentials.

       User-added image

6. Click OK  on all the three dialogs to close Control panel. The DSN has now been defined.
7. Launch Statistica Enterprise Manager and right click on Database Connection and click on "New OLEDB Database connection"  ( Or  File  >> External Data >> Query >> Create from Statistica) 
     User-added image
8. Choose the Microsoft OLEDB provider for ODBC drivers. Click Next .

     User-added image

 9.    Select the Data Source defined in Step 6 from the drop down list for Use data source name.Type username and password and select the option to Allow saving password (to avoid being prompted for password every time) . Click on Test Connection to test the connection details. 

       User-added image


  10. Click on OK twice to close both the dialogs. Define a name for the database connection, it access permissions and then click on Commit on the top left hand of the screen.
    
     User-added image
   11.  Right click on any folder and choose "Create a new Data configuration" 
          User-added image

12. Name the data configuration, choose the database connection that was defined in Step 10 and then click on New button near Queries. 
    
    User-added image

13. Type the SQL Statement or Click on SQL Wizard to build SQL graphically.

      User-added image

14. If you picked SQL Wizard, pick the database and tables involved - drag and drop from the left pane to the right pane and define the query and click on the green triangle to close the query builder dialog and return to Enterprise Manager
        User-added image

15. Enterprise Manager now has the SQL statement defined. Define Access permissions for the data configuration and click on commit on top left hand corner of Enterprise manager. 
     User-added image
16. Click on the data configuration and then click on the Explore button to bring back data from SAP HANA into Statistica for further analysis. Alternatively, you may choose to use a workspace with Enterprise Data configuration node and point to the data configuration built in Step 15. 
   User-added image