Archived discussions are read-only. Learn more about SAP Q&A

How to run batch file to invoke a .ctl file to import data from Excel into SAP HANA?

Hello friends:

I have successfully imported data from .csv into SAP HANA.

Now I have a scenario where in I want to use a batch file to invoke .ctl file to import data from Excel into SAP HANA.  The reason is I want to run the batch file at  a scheduled interval, lets say 15, 30 min.

If it is not possible, can I do a scheduled import in SAP HANA studio itself?

Thanks in advance.


  • SAP Employee

1. not sure what additional information you are looking for - section "Setting Up a Data Backup Using Cron" describes all the steps you need. You can also call hdbsql -h as user <SID>adm to see all the command line options.

For importing a CSV file, just replace the SQL statement. If you want to make sure there's a fresh file present for the import, you would have to write you own shell script, test for the existence of a current *.csv file and only then call hdbsql to import the file. Needs some shell scripting skills...

2. no. On cloudshare you don't have access to the OS of the server, so you cannot automate file import on the trial sandboxes. You will have to get your own HANA instance (e.g. on How to create a SAP HANA Developer Edition in the cloud). Or you can experiment with the automation from the cloudshare desktop, hdbsql.exe is also part of the SAP HANA Client (in C:\Program Files\sap\hdbclient).


0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question