I’m getting the below error when trying to insert a value dynamically from a datatable using foreach into mysqldb.
Below is the query i ‘ve used.
"INSERT INTO INPUT_TABLE (START_DATE) VALUES (STR_TO_DATE( @START_DATE,’%M %d %Y’)"
Could anyone please help me out?
Thanks in advance
April 19, 2020, 10:53am
pls check the format of @Start_date and change the STR_TO_DATE format accordingly.
format should be ‘%d %m %Y’ or %m %d %Y (small d, small m, and caps Y)
@GBK, changed the values as you said. Still getting the same error.
could you please let me know if anything else needs to be changed?
April 19, 2020, 11:24am
Can you log the insert statement using log message activity and share it with us?
there could be a possibility of input data issue…
“INSERT INTO INPUT_TABLE (START_DATE) VALUES (STR_TO_DATE(
@START_DATE,’%m %d %Y’)”