on 06-23-2014 10:18 AM
Hi HANA-Experts,
I would like to import csv-files in which a comma is used as decimal point seperator.
Per Default HANA expects a dot. Can you please tell me how to change the data format?
I know that I can change the seperator in the source file, but that's not the solution I'm looking for!
Thanks for your help!
Isabell
Hi Isabell,
currently there is no way to do that for the IMPORT/IMPORT FROM statements.
Either you use a proper data loading tools like SAP DataServices or you prepare the import file so that the decimal separator is a dot.
- Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
as there's already the possibility to change the time-format during imports, I'm looking forward having the possibility to specify the number formats as well.
Meanwhile, here's a workaround which could be applicable for certain scenarios.
Best regards,
Til
DROP TABLE T;
--import your values including comma
CREATE TABLE T (KEY INT PRIMARY KEY, VAL NVARCHAR(20));
INSERT INTO T VALUES (1, '1,2');
INSERT INTO T VALUES (2, '2,3');
-- add a decimal-column
ALTER TABLE T ADD (VAL_DEC DECIMAL(17,2));
-- copy the "comma-column" to the new decimal-column
UPDATE T SET VAL_DEC = replace(VAL, ',','.');
-- get rid of the comma-column and rename the decimal-column appropriately
ALTER TABLE T DROP (VAL);
RENAME COLUMN T.VAL_DEC to VAL;
select * from T;
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.