HXE, DBeaver and CSV files!
This past week I was in Bern at the SAP CodeJam – Getting started with HXE. Now we do lots of CodeJam events and we work hard to be sure we have answers while we are there. Unfortunately there is always a chance that there is something we just do not have an answer for when we are there.
It was one of those cases this past week for me. During the CodeJam we had several people actually try different SQL clients to connect to their HXE systems. In particular (most likely because we have a blog with it) they tried DBeaver.
They were working off this this tutorial, SAP HANA, express edition, server-only: Create tables and upload data. The challenge though was “How do I upload the CSV file“?
Now of course they could upload the file to the server and execute the SQL command to do the import but the question came up – “Why can’t I use the client like I did with the SAP HANA Studio?”
So I decided to dig a little deeper and see if I could figure out what we were missing during the event. So here you have it the alternative steps for use with DBeaver.
In the above listed tutorial in step 5 we give you an SQL script to execute to load the CSV which is on the server already. But what about on your local client?
To do this with DBeaver we will need to create a new connection first, you need to create a CSV file connection and select a folder on your computer as the source. That’s it, seriously that is really all it is.
Now that you have made the connection you will see that you have a new entry in the left column that now shows a table entry for each CSV file you have.
The next step is rather simple, select your actual table in the HXE system and right click and choose Import Table Data.
Now you will follow the wizard.
Select the table.
Next be sure the mappings are done correctly.
If not things won’t work.
Double check your source and target systems.
Now execute it.
If it all works OK then you should now have a rather large dataset now uploaded. I actually took a small 7MB file from the website which resulted in 196,930 records into the TRIPS table.
Playing around with the settings in the wizard would have yielded better performance and if the performance was not what you hoped for you can always return to the process of uploading the CSV to the server first.