The escaped date format
load_data = """LOAD DATA LOCAL INFILE %s INTO TABLE table1
FIELDS TERMINATED BY '|' ESCAPED BY '' (@ADate)
SET ADate =
IF(@ADate = '', NULL, STR_TO_DATE(@ADate,'%%c/%%e/%%Y %%h:%%i:%%s %%p'))"""
cur.execute(load_data, (ed_file,))
keeps triggering on execute line:
mysql.connector.errors.ProgrammingError: Not enough parameters for the SQL statement
Any suggestions how to fix the problem?
create table table1 (ADate datetime);
ed_file could be empty single line.