Hi, I need help inserting data to mysql db, I have a button with this code:
date = system.tag.read("Production/date")
user = "System"
notas = "ejemplo notas"
id = system.db.runPrepUpdate("INSERT INTO prueba (date, user, notas) "
+ "VALUES (?, ?, ?)", [date, user, notas])
When I try to insert data to my DB I have this error:
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO prueba (date, user, notas) VALUES (?, ?, ?), [Fri May 22 17:52:55 ART 2015,Good], System, ejemplo notas], , , false, false)
caused by Exception: Error executing system.db.runPrepUpdate(INSERT INTO prueba (date, user, notas) VALUES (?, ?, ?), [Fri May 22 17:52:55 ART 2015,Good], System, ejemplo notas], , , false, false)
caused by GatewayException: SQL error for "INSERT INTO prueba (date, user, notas) VALUES (?, ?, ?)": Data truncation: Incorrect datetime value: '’' for column 'fecha' at row 1
caused by MysqlDataTruncation: Data truncation: Incorrect datetime value: '’' for column 'date' at row 1
I don’t know how to format the date to be a valid date to insert into my mysql db, I’m using now() in the tag.