10 Jun
2016
10 Jun
'16
12:44 p.m.
Hi,
i have an issue with the "copy into" statement and a csv file. In the documentation[1] it says: "Field and record separators can be embedded in quoted fields." This does not work in v11.21.19.
example.csv: 1,"\,\,",42,, 2,",,",23,,
create table issue(id int, str varchar(32), val int, empty int); copy into issue from 'example.csv' using delimiters ',' NULL AS '';
Use:
copy into issue from 'example.csv' using delimiters ',','\n','"' NULL AS '';
You need to say that you're using quoted strings in the input (the third delimiter). And in order to specify the third delimiter, you need to specify the second as well.
thank you for the quick responds. It works like a charm. Kind of surprising that escaping the delimiters works then. Regards, Frank