JdbcSQLSyntaxErrorException function DATE_ADD not found

23 Views Asked by At

I tried to use the MySQL function DATE_ADD in a nativeQuery

UPDATE my_table SET my_date = DATE_ADD(my_date, INTERVAL 1 HOUR)

but I got the error:

JdbcSQLSyntaxErrorException function DATE_ADD not found

1

There are 1 best solutions below

0
RotS On

I could solve the problem by simply using "+" which also works:

UPDATE my_table SET my_date = my_date + INTERVAL 1 HOUR