cancel
Showing results for 
Search instead for 
Did you mean: 

How to Access Relational DB from Python in SAP DI

i033659
Advisor
Advisor
0 Kudos

Hello all,

Which possibilities are there to connect from Python in SAP DI to a HANA DB or more generally to any relational DB?

  1. Can I use connections from the connection manager in SAP DI to connect to a relational DB from Python?
  2. For HANA this would be possible using the hana_ml library.

Are there any other ways (OData, native libraries, hdbcli, ...)? What are pros and cons?

Thx, Ingo

Accepted Solutions (0)

Answers (2)

Answers (2)

lochner_louw
Participant
0 Kudos

Hey Ingo,

Depends in which context you are referring to. If you directly want to connect to HANA from Python in an ML context then you can use hana-ml package or the built-in SAP DI SDK.

In Jupyter on DI check blog by Andreas Forster. He has an example where he get the HANA connection to use with hana-ml.

SAP DI SDK:

You can have a look at the HANA ML Python SDK examples here:

Thanks,

Lochner

andy_yin
Explorer
0 Kudos

Hi Ingo,

SAP DI provides various operators to connect and work with HANA DB. Here is a good overview . To connect to the DB listed in DI connection manager with python, you can probably refer to here. You can also add third party database support in SAP Data Intelligence by building your own Dockefile to import the library of your choice.

.