1.- Create an CSV file with your data
2.- Copy the file to dropbox/yourname inside the HANA box
3.- Create a table in HANA with the structure of your file
4.- create the control file BBB with the following information:
import data
into table XXX."YYY"
from 'ZZZ.csv'
record delimited by '\n'
fields delimited by ','
optionally enclosed by '"'
error log 'Text_Tables.err'
Where XXX is your schema, YYY is your HANA Table and ZZZ is your file
5.- Open an Script File and write the following:
LOAD FROM '/filer/dropbox/yourname/BBB.ctl';
where BBB is the name of your control file
Greetings,
Blag.
Hello,
stupid question - what is dropbox? Never heard about it... ![]()
Tomas
Dropbox is the name of the shared folder we use on the HANA Dev Center. Do you have access to it? Or you're using HANA in your company as part of the ramp-up?
Greetings,
Blag.
Hello,
that explains - no I do not have access - we have own HANA.
Thanks for explaining.
Tomas
With the recent upgrade to the HANA SP3...the method to upload files to HANA has been slightly changed...so here's the updated tutorial:
1.- Create an CSV file with your data 2.- Copy the file to the HANA Dev Center 3.- Open a FTP connection to ftp.sapdevcenter.com (You can find the user name and password by doing a select to SYSTEM.FTP_SERVER) and....*Don't paste the Username or password here or any other place!* 4.- Create a folder with your name on the FTP site and copy the file there 4.- Create a table in HANA with the structure of your file 5.- create the control file BBB with the following information: import data into table XXX."YYY" from 'ZZZ.csv' record delimited by '\n' fields delimited by ',' optionally enclosed by '"' error log 'Text_Tables.err' Where XXX is your schema, YYY is your HANA Table and ZZZ is your file 5.- Open an Script File and write the following: IMPORT FROM '/dropbox/yourname/BBB.ctl'; where BBB is the name of your control file
I just test it and it works...if it doesn't work for you, please let me know
Greetings,
Blag.
Thank you for the guide. I tried to get credentials from the SYSTEM.FTP_SERVER on hanasvr-02 and it does not exist (also checked on TABLES public synonym). Could you please have a look...?
Regards,
Adam
Edited by: Adam Podraza on Nov 17, 2011 4:35 PM
Hi Adam
It does exist now...
--Juergen
Excellent, it works, thank you.
However one thing to keep an eye on: even though importing from file is successful, the message in HANA Studio is showing 0 records are loaded:
Statement 'IMPORT FROM ...' successfully executed in 78 ms 510 µs - Rows Affected: 0
Regards,
Adam
Hi Adam
Yes, the "rows affected" counter does not work for imports, only update statements. To check if your data has been loaded, either
- do a row count by executing SELECT COUNT(*) FROM my_table; or
- check if an error log file has been written (as instructed in your .ctl file) and what the content is
--Juergen
Edited by: Rajarshi Muhuri on Nov 27, 2011 3:39 PM
Edited by: Rajarshi Muhuri on Nov 27, 2011 3:40 PM
Edited by: Anand Gupta on Nov 28, 2011 4:55 PM
Hey Blag,
Has anyone else reported issues uploading to this FTP drop? I tried to create a folder a few times and upload files with the user in the table on the box and it creates a weird copy of the folder under itself and won't let me delete.
The issue can be seen in the ev, ev2, and S0006858445 folders. It's weird I used a shell and Cyberduck with the same result.
Any guidance is appreciated here.
Thanks.
Eric:
AFAIK no one has complaint yet...I used myself Filezilla, but I don't think the client has anything to do...right now I have some troubles with my Cloudshare user, so can't test it right now...sorry about that...hopefully Juergen will kick in a shed some light...
Greetings,
Blag.
No worries. It's funny you posted now. I was literally just going in to reply I was able to upload to the root folder, just not a sub-folder. Odd.
Thanks anyway. I just loaded my first table. Woo hoo!
Cool! -;) Sometimes it's not easy to handle those FTP folders...that's why I used Filezilla -:)
Greetings,
Blag.