Skip to main content
Question

using COPY command to skip column

  • September 5, 2019
  • 2 replies
  • 11 views

elghali
Forum|alt.badge.img+1

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

2 replies

elghali
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • September 5, 2019

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


viganog
Forum|alt.badge.img+1
  • Participating Frequently
  • September 5, 2019

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 ','