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.
Are you using DataServices to run the scheduled job? Using DataServices you can schedule job to read from files and import to HANA.
Apart from Dataservices, if there is a import command that can be invoked from a Unix shell script, then you can also schedule it as a cron job.
As part of the HANA Client installation, there is an executable called HDBSQL. It is an operating system command line tool for executing SQL statements. Page 20 of this guide (http://help.sap.com/hana/hana1_imdb_backup_en.pdf) talks about using the tool for running backups. However the general setup of the hdbuserstore would be helpful for general purpose usage of HDBSQL as well.
Thanks Thomas for directing me to this document.
1. Can you please direct me to a case study or steps to run a cron job from command prompt of SAP HANA studio's machine?
2. Has anyone performed this task on SAP HANA experience on cloudshare
Hello SAP HANA development team:
Can you please guide me on this?
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 AWS). 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).