Skip to Content

SAP supports ODBC drivers for most commercial databases (Oracle, DB2, MS SQL) or big data engines (Hadoop, Netezza).

Common guidelines for SDA configuration are already available on SCN or HANA Academy and will be not discussed here.

If you would like to use 3rd party ODBC database driver, you could face following difficulties:

  • ODBC driver library cannot be loaded by HANA

It means that some called functions are not implemented within the driver, most likely caused by missing unicode support. Unicode ODBC functions ends at W. To load the driver, at least SQLDriverConnectW, SQLTablesW and SQLColumnsW functions must be available.

You can use linux command available by default on hanabox objdump –T driver_library.so | grep “SQL[A-Za-z ]*W” to list available W functions in driver .so library.

Some drivers are not compiled with these W functions by default. In case of open source drivers, please look at the source code and makefile. In some cases, these functions are compiled only if defined WINTERFACE. To define this, add –DWINTERFACE in makefile CFLAGS.

If still not loaded, compile it only with these three W functions plus functions called from these three (usually Unicode to UTF8 conversions of catalog and schema name).    

  • Database catalog, schema and tables not visible in HANA Studio Provisioning

Please check your database catalog/schema capability. Non-empty catalog name is mandatory, schema name is optional. These parameters are returned to HANA from SQLTablesW function. Review the sql statement used to return list of tables. Statement must return at least TABLE_CAT, TABLE_NAME and TABLE_TYPE.

  • You have to specify database property file during remote source definition in HANA studio. It is partly important for nontrivial sql statements, used functions or data types and doesn’t need to be adapted to common sql queries and basic data types. Please go to subdirectory config of HANA exe directory and copy existing property file for example property_maxdb.ini to property_yourdb.ini. Specify this file in the remote source.
To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Roman Bukarev

    Hi Jachym (I hope you still read SCN), thanks for this troubleshooting bit, it gives more insight into what’s happening behind the scenes.

    I’m trying to connect HANA via an ODBC driver to Apache Drill using a dummy property_drill.ini property file, and getting “ODBC driver library cannot be loaded by HANA” type of problem. I see from objdump that all mentioned SQL*W functions have been implemented. At the same time, I see that no logs nor trace is being generated by the driver itself.

    Interestingly, when I use a file property_mss.ini (or any other SAP-provided file), the process still fails, but with a different error and seems to go a bit further. I see the following in the driver’s tracefile:

    “Jan 17 11:29:04.836 TRACE 1251956480 DRConnection::DRConnection: +++++ enter +++++
    Jan 17 11:29:04.836 TRACE 1251956480 Connection::SQLSetConnectAttr: +++++ enter +++++
    Jan 17 11:29:04.836 INFO 1251956480 Connection::SQLSetConnectAttr: Attribute: SQL_ATTR_ANSI_APP (115)
    Jan 17 11:29:04.836 TRACE 1251956480 ConnectionState::SQLSetConnectAttr: +++++ enter +++++
    Jan 17 11:29:04.836 TRACE 1251956480 ConnectionAttributes::SetAttribute: +++++ enter +++++
    Jan 17 11:29:04.836 TRACE 1251956480 Connection::SQLDriverConnectW: +++++ enter +++++
    Jan 17 11:29:04.836 TRACE 1251956480 ConnectionState2::SQLDriverConnectW: +++++ enter +++++
    Jan 17 11:29:04.867 ERROR 1251956480 Connection::SQLDriverConnectW: [MapR][ODBC] (10360) Invalid connection string.”

    Do you have any hints how to interpret this? Something wrong with setting an attribute SQL_ATTR_ANSI_APP?

    Thanks! /RB

    (0) 

Leave a Reply