Hi all,

Recently, I needed to upload excel files on HANA but not via the navigation.

/wp-content/uploads/2015/11/blog_import_1_838954.png

Because what I wanted, was to find an automated way to upload multiple files at once.

After lots of searching I figured out that uploading .csv and .xlsx files on HANA through an SQL command required to have access at the HANA Server, which is impossible because I was working with the HCP Trial.

So I had to find a way to do it; And this is what I did.

1) Create an HCP Trial account from SAP HANA Cloud Platform Cockpit and create a new HANA Instance with a name of your choice (mine is called hanaxs)

  

    When the process is finished you should be able to see this screen (November 2015)

/wp-content/uploads/2015/11/blog_import_2_838998.png

2) Then I connected to the HCP through a tunnel using the Web SDK.

– Navigate to SAP Development Tools for Eclipse and then select for download the neo-java-web-sdk-1.91.9.zip from the Cloud section.

  Once downloaded, you should see a folder with these contents:

/wp-content/uploads/2015/11/blog_import_3_838999.png

   Then holding the shift button right click on the tools folder to open a command prompt. Then, inside the cmd type the following command with your credentials.

neo open-db-tunnel -h hanatrial.ondemand.com -i your_hana_instance_name -a i/c/p/number_at_the_end_add_the_word_trial -u i/c/p/number

Pressing enter you should see this screen where you should type your password:

/wp-content/uploads/2015/11/blog_import_4_839012.png

If the password is correct you have just created a tunnel with the HCP and this is (kind of) what you should see:

/wp-content/uploads/2015/11/blog_import_5_839013.png

You are going to need these info so make sure the tunnel will not close.

(If for any reason, you accidentally close the tunnel you can repeat the process and a new password will be provided to you)


The first part is finished – On the second part we will describe how we will connect to HANA using a node.js script,



Best Regards,


Christoforos Verras

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Juergen Kissner

    Hi Christoforos,


    you wrote:


    “After lots of searching I figured out that uploading .csv and .xlsx files on HANA through an SQL command required to have access at the HANA Server, which is impossible because I was working with the HCP Trial.”

    Well, your statement is only partly true: With the SQL statement (running on the HANA VM) you can only upload files that are visible in the context of that statement. Obviously, our HANA VM in HCP does not see your local PC, so the SQL statement for upload has to fail. That does not have anything to do with a Trial account. It applies to productive HANA instances as well.


    I am sorry that you needed to do “Lots of searching” to find that out. After you posted your problem in the community, I had answered it in less than 2 hours [1]. So, the lesson learned is hopefully: Don’t try too hard; instead ask the community 😉 .

    Best regards,

       Juergen


    [1]Re: Import csv files via SQL doesn’t work


    (0) 
    1. Christoforos Verras Post author

      Hi Juergen,

      That’s why i wrote “it was impossible to have access to the HANA server, because i was working with the HCP Trial” !

      Regarding the searching you said, I really think that asking has to be the last option 🙂

      Best,

      Christoforos

      (0) 

Leave a Reply