Issue with columns with comma values



I am trying to load the csv file on the vertica table.


I am having the issue since the column value itself has comma on it and columns seems to have shifted


row e.g.


"6027007","US","United States","WV","West Virginia","588","Clarksburg-Weston, WV","25301"


column "dblabel" which has the value "Clarksburg-Weston, WV", has varchar(55) on it. 


copy command I am using is:


COPY tbluser FROM '/vertica/tbldata.csv' UNCOMPRESSED DELIMITER ',' DIRECT;


Any suggestion?


  •  Not sure i understand what you need. (what do you mean by "shifted" ?)

    But if yo want to load the data even the data can contain your delimiter use the enclosed parameter.

    dbadmin=> create table tbltest(addr varchar(50), nr int);
    dbadmin=> copy tbltest from '/tmp/test' delimiter ',' enclosed by '"' direct;
    Rows Loaded
    (1 row)

    dbadmin=> select * from tbltest;
    addr | nr
    Clarksburg-Weston, WV | 25301
    (1 row)


Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file