Hi I am have the following CSV format
id (tab) creation_date
-------------------------
1 2012-05-04 15:26:45.000
2 NULL
For the importing I am using:
load data local infile './test.csv' into table TEST fields terminated by '\t'
lines terminated by '\n'
IGNORE 1 LINES
(id,@creation_date)
SET
creation_date = nullif(@creation_date,'NULL');
But unfortunately the NULL value (String) is not interpreted and set to a NULL in the column. Instead I get a warning about data truncation and a default date is inserted 0000-00-00....
How can I check: Is String = "NULL" then insert NULL into column?
NULLwith\N, you can load it correctly without theSET: dev.mysql.com/doc/refman/5.7/en/…