Options

using COPY command to skip column

Hello, I am trying to load a file into a table using COPY command, considering the source file contains columns col1, col2, col3 and the destination table contains columns col1, col2, col3 also.
I want to skip col2 from loading (I want to keep it NULL in the destination table)
I tried to use FILLER but it didn't work, so how to skip this column please

Tagged:

Answers

  • Options

    COPY t1 (col1,
    v1 FILLER VARCHAR(20),
    col3)
    FROM LOCAL 'C:\folder\file1.csv'
    WITH DELIMITER AS ','

  • Options

    please try in this way:
    COPY t1 (col1,
    f_v1 filler VARCHAR,
    col2 as NULL,
    col3)
    FROM LOCAL 'C:\folder\file1.csv'
    WITH DELIMITER AS ','

Leave a Comment

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