Modifying a column during COPY

Moderator: NorbertKrupa

Post Reply
ChiaraC
Newbie
Newbie
Posts: 1
Joined: Tue Jun 17, 2014 3:47 pm

Modifying a column during COPY

Post by ChiaraC » Tue Jun 17, 2014 4:02 pm

Hi all,
I'm trying to load a csv with this command:
COPY HTTP_PROVA2_TB (rhct, dcl)
FROM LOCAL 'provarecord2.csv.gz'
GZIP
DELIMITER ','
EXCEPTIONS '///provarecord2.csv.gz_exceptions'
REJECTED DATA '///provarecord2.csv.gz_rejected_data'
ENFORCELENGTH
ENCLOSED BY '"';

where provarecord2.csv.gz is:
"*/*;q=""0.001""",41539

ENCLOSED BY option is not enough: loading fails because of "" characters inside the first field.

I want to modify the first field while loading, for example with replace a function like this REPLACE(rhct, '""','+'). Is it possible to specify function like this in the COPY command? Or is there any other way to do the same thing?

Thank you

Post Reply

Return to “Vertica Data Load”