cancel
Showing results for 
Search instead for 
Did you mean: 

How to Automate the Csv files to load the updated data in HANA database?

Former Member
0 Kudos

Things that i have done :

One time load of bulk data with ctl files using HANA studio by storing the ctl and csv on the HANA server.

things that are to b implemented:

How to automate the task of loading the updated csv files into the HANA server.

How to automate to load the contents into the database without using HANA studio.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I have solved the 2nd que . .ie to load the contents into the database using HANA database server.,without using HANA studio ...

I have implemented this using shell scripting code with HDBSQL connectivity to HANA database.

hence if i have to import the data ,then using the shell scripts i can easily do that.

Now 1st que is still a hurdle

Former Member
0 Kudos

i have successfully automated the task by using Cron sheduler

Former Member
0 Kudos

Hello Shweta,

                    My first query is how did u automate loading CSV file form your local system into server.( i mean u still have to execute the command on HDBSQL for ctl to work )

My second query  is were u able to load different .csv file for different time slots into the table.

Please give me a detailed explanation for the same or email me(on prateek.arora@1-enterprise.com)  the step by step process u adopted for the same.

Thanks

Prateek A

Former Member
0 Kudos

Hi Pratik,

the ans to your first question is i have used File Zhila to tranfer files from my local machine to the server.

But once its deployed on the server , i have maintained a logic where in once all the csv files gets load ed then the corressponding CTL files will load the data from only that CSV files which are updated.

To answer your second query , i have maintained only one csv file for each table and my logic is checking the csv file in specific folder and loading the data inside HANA .

thanks,

shweta kapgate

Answers (4)

Answers (4)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hello friends,

                    My query is how will you use cron to load data from different csv file. for example data for day 1 is in day1.CSV and for DAY 2  is in day2.CSV as filename will be fixed in the commad from what I know.....

former_member182302
Active Contributor
0 Kudos

Hi Prateek,

Have a look on this blog:

Regards,

Krishna Tangudu

Former Member
0 Kudos

Hi Shweta ,

Its answered so kindly make it answered still its showing as not answered...

Regards,

Mahesh

Former Member
0 Kudos

Hi Shweta,

The automation of these tasks using the HANA Studio method is currently not possible. For repository access the HANA Studio uses a tool called 'regi'.

Though you can try a workaround(I have not tried this ever and its a whacky solution but its a possibility)

For 2nd doubt of automating the content of disk to load to DB

1. You may like to explore into this http://help.sap.com/hana/html/sql_import_from.html

2. Now you will have to execute it repeatedly(i.e schedule) - I am not aware if HANA has some     scheduler within its DB part.

    But you should be able to call this command from an XS app(A simple .xsjs will also do)

3. Now you will get a URL that you can put into a batch file and then schedule this on a windows machine using Windows Scheduler.

The problem with this is that the import file must be present on the server, which brings us to your 1st doubt. The solution to this is similar to the 3rd step in the last part.

In Windows, you will have to create a batch job with the commands for copy and paste of files into the server(This might be tricky as HANA is a Linux machine and I am not sure how these things work in Linux). This needs to be scheduled again using the task scheduler

If you also have SAP DS in your landscape then a simpler alternative to all this would be scheduling a job in DS for updating the tables with data from a flat file.

There could be simpler solutions out there as well. But please let us know how you implement this.

--

Shreepad

Former Member
0 Kudos

Hello ,

as per the requirements we must not have to use DS. at all.

So now either i have to write shell scripts to load the data automatically into the hana without using hana studio.

do u have any shell scripting code snipets or some mechanism as in how to impliment the data load ?

Former Member
0 Kudos

Hi Shweta,

I am sorry but I don't have knowledge on shell scripting. But found this nice blog after googling http://aruljohn.com/info/filetransfer/.

Hope this helps.

--

Shreepad