Sandeep Mohanty
Sandeep Mohanty

Reputation: 1552

iterate over multiple tables in HANA

I have 4-5 tables in my SAP HANA database. My requirement is to list all tables and iterate over each table and store each table data to individual csv files.

I want to perform these activity using python. I am using the hdbcli library for this.

Thank you.

Upvotes: 0

Views: 178

Answers (1)

Mathias Kemeter
Mathias Kemeter

Reputation: 1193

You can use the collect() method of the hana-ml dataframe and subsequently export using Pandas to_csv(..) method.

connectionContext.table('my_table').collect().to_csv(..)

For this approach, you need to use hana-ml instead of hdbcli.

Upvotes: 1

Related Questions