SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Connect to Data Lake Relational Engine Using the ODBC Driver

Configure a data source to connect to the previously created data lake Relational Engine and then use the data source in unixODBC and Microsoft Excel.

Overview

🎓 beginner 10 min. SAP HANA Cloud Data LakeBeginnerSAP HANA Cloud

You will learn

  • โœ”How to create an ODBC data source for a data lake Relational Engine connection
  • โœ”How to use the configured data source with other applications

Prerequisites

Prerequisites

  • You have completed the first tutorial in this group.

Steps

Intro

Open Database Connectivity (ODBC) provides an API for accessing databases. Database vendors provide ODBC drivers for their database products. An application written to the ODBC standard can be ported to other databases that also provide an ODBC interface.


Step 1 Configure a data source on Linux with unixODBC
โ€”

  1. On SUSE Linux, unixODBC can be installed using Zypper or YaST.

    Shell
    sudo zypper install unixODBC

    unixODBC install
    unixODBC install

    For more details on how to accomplish this, please follow the second step of this tutorial.

  2. The following commands can be used to confirm that unixODBC is installed and determine the location of the .odbc.ini file (if it exists).

    Shell
    cd /etc/unixODBC
    odbcinst -j

    odbcinst -j
    odbcinst -j

  3. Navigate to the directory where the .odbc.ini file is located, similar to the one highlighted in the screenshot above. Open or create the .odbc.ini file with the following command:

    Shell
    pico .odbc.ini
  4. Configure the values of driver and host so that they conform with your setup. Note that with the developer licensed version of the data lake client, the driver path below is slightly different.

    .odbc.ini
    [HC_DL]
    driver=/home/XXXXX/sap/dlclient/IQ-17_1/lib64/libdbodbc17.so
    driver=/home/dan/sap/hdlclient/lib64/libdbodbc17.so
    encryption=TLS(trusted_certificates=*;direct=yes)
    host=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.iq.hdl.XXXX-XXXX.hanacloud.ondemand.com:443
    integrated=NO
    log=/tmp/hdlclientlog.txt

    Here the driver path is the path to your libdodbc17.so file.

  5. DBISQL or isql, which is a tool provided by unixODBC can be used to try out the data source. Ensure you are using the correct username and password.

    Shell
    dbisql -hdl -c "uid=USER1;pwd=Password1;dsn=HC_DL" -nogui
    isql -v HC_DL USER1 Password1

    dsn is the name set in the odbc.ini file in the previous step.

    DBISQL

    Some example queries you can run are listed below.

    SQL
    SELECT * FROM HOTELS.CUSTOMER;
    SQL
    SELECT * FROM HOTELS.ROOM;

    ODBC example with dbisql
    ODBC example with dbisql

    isql

    isql query
    isql query

    To exit dbisql or isql type quit.


    The column width when displaying results in isql can be set using the -m parameter.

    Shell

    isql -v HC_DL USER1 Password1 -m6

    Code
Step 2 Configure a data source using Microsoft Windows ODBC Data Source Administrator
+
Step 3 Use a data lake data source from Microsoft Excel
+
Step 4 Knowledge check
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Configure a data source on Linux with unixODBC 2. Configure a data source using Microsoft Windows ODBC Data Source Administrator 3. Use a data lake data source from Microsoft Excel 4. Knowledge check

Learn more →