I am trying to insert into sql from a csv file.
LOAD DATA INFILE "file.csv"
INTO TABLE table_name
FIELDS TERMINATED BY " "
LINES TERMINATED BY "\n"
(
id,
name
);
My csv has the format:
123 Bob
or:
124
I want to have a default name for the case where the name isn't present. I set up the column to have a default value:
ALTER TABLE table_name
ADD COLUMN name
varchar(255)
DEFAULT 'jerry';
However, when I run the insert, it is just putting empty values into the name column