I have a csv file which I want to load into a table. It has a column with the following date format:
'%d-%b-%y'
For example: '01-Dez-18'
. If I load this file considering the format:
IF(@entry_dt = '',NULL,STR_TO_DATE(@entry_dt, '%d-%b-%y'))
I get a warning:
Incorrect datetime value: '01-Dez-12' for function str_to_date
This is due to the format of the column which is de_CH
but the local and global settings are en_US
. That is the reason why 01-Jan-12
was loaded correctly. Changing the local setting
SET lc_time_names = 'de_CH';
does not work since:
lc_time_names does not affect the STR_TO_DATE() or GET_FORMAT() function
(see here).
Is there a way to load the date column considering German/Swiss notation?