cancel
Showing results for 
Search instead for 
Did you mean: 

How to Access Relational DB from Python in SAP DI

IngoPeter
Product and Topic Expert
Product and Topic Expert
0 Kudos
794

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

View Entire Topic
lochner_louw
Product and Topic Expert
Product and Topic Expert
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