The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

Hardcoding values into Copy statement

Hello, I have a scenario where in I need to load table from flat file using COPY command The file has just one column the table has 5 columns first column needs to be loaded form the flat file and 3 column need to be hardoced( with some values) and last column is a sysdate(). Can anybody help me to achieve this. I wonder how copy statement can hardcode the value for specific columns.

Comments

  • Hi Navin, You can do it like this copy test(c1, c2 as '2', c3 as '3', c4 as '4', c5 as '5') from 'FILE"; Where c1 that has nothing as will be the one that load the data from the file. Hope this helps, Eugenia
  • Thanks for that Eugenia, That did the trick.

Leave a Comment

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

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.