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.

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()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.