0

Forgive me if this is something obvious or a simple question. I am having issues with my date field when loading data into my database. I am having it load using a python script using the below command and once complete the date is 0000-00-00.

the file I am loading is a CSV file and I am using the following command

LOAD DATA INFILE 'myfile' IGNORE INTO TABLE mytable COLUMNS TERMINATED BY '\t' LINES TERMINATED BY '\n' IGNORE 1 LINES

In Mysql the date columns type is date

Any direction or help is appreciated.

1
Contributor
1
Reply
11
Views
4 Years
Discussion Span
Last Post by crag0
3

figured it out. I needed to use the SET date = CURDATE().

LOAD DATA INFILE 'myfile' IGNORE INTO TABLE mytable COLUMNS TERMINATED BY '\t' LINES TERMINATED BY '\n' IGNORE 1 LINES SET date = CURDATE()

Edited by crag0

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.