Transform data during load in Vertica – use variable with COPY

How can we do an average of the first two column and load it into the third column using a stored value of a Vertica vsql variable.

Extract the number of column in the csv file minus the one column you will store the output and store it in a variable called count.

  • our data sample is a bellow:

 Extract the column count

Run the full script

Done, happy transforming 🙂



I hope this was helpful and i appreciate if you would like, subscribe or share our posts. I it is just a click


Similar Article  Live Documentation in Vertica using comment on
No Comments
Leave a Comment

%d bloggers like this: