← Back to team overview

maria-discuss team mailing list archive

New Question: How to define a date in order to import an empty date from a CSV file?

 

Hello,

A new question has been asked in "Data Types" by JohnD:
--------------------------------
I have a CSV file containing amongst other things a couple of date columns. Some of the date values are empty - that is just ",," - a comma followed by another comma.

The date rows in the table are defined like this:
	`PTY_USR_PASSWORD_DATE` DATE NULL DEFAULT NULL,

But when I import the data (using HeidiSQL), I get the following error:
/* SQL Error (1292): Incorrect date value: '' for column 'PTY_USR_PASSWORD_DATE' at row 1 */

How should I set up the table to allow this? Or how can I modify the CSV?

John D.
--------------------------------

To view or answer this question please visit: http://kb.askmonty.org/en/how-to-define-a-date-in-order-to-import-an-empty-date-from-a-csv-file/