Power of Python Integrated with SAP HANA
Python is a high-level, object-oriented programming language for the web.
Python is easy to write, easy to read and easy to understand.
SAP HANA works quite well with Python.
This article gives a basic idea of how to use Python on SAP HANA.
Note: Even if you are not familiar with Python, do not worry. We are all and cover everything in detail for you.
There are several APIs available for free Python for SAP HANA. In this article, we are one of the easiest, use the DB-API.
dbapi API is Python DB-API 2.0.
Configure Python API in SAP HANA:
1 Navigate to the location where you installed the client HANA and copy these three files.
__init__.py dbapi.py, resultrow.py
By default it is installed in C: Program Files folder Filessaphdbclienthdbcli.
2 Navigate to the folder under the folder HDBClient Python and copy all three files in the lib.
By default, the path C: Program FilessaphdbclientPythonLib
3 Copy pyhdbcli.pdb, pyhdbcli.pyd files from hdbclient.
By default, this location is "Program Filessaphdbclient C" is
4 On the same folder pythonlib and add these 2 files.
This is all.Configuration done! ...
Connect to SAP HANA and Run SQL Queries using Python:
1. Write below code in a notepad and save with .py extension.
2. Provide system data HANA and recording information of the file.
3. Make sure that you change the name of the schema with your schema.
4. Now save the file in the folder hdbclientPython.
The default location of Python folder "C: Program FilessaphdbclientPython"
5. Open ask. Switch to the Python path, and run the command