2

Can someone help me out here- getting following errors while running DML commands.

Caused by: org.h2.jdbc.JdbcSQLException: Function "TO_TIMESTAMP" not found; SQL statement:

Ajay Kumar
  • 4,864
  • 1
  • 41
  • 44

2 Answers2

1

Finally i got this answer, we were using older version of h2 database dependency in our project. for Quick fixed,Take out latest dependency and add in your pom.xml file.

<dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.4.195</version>
 </dependency>
  1. http://www.h2database.com/html/download.html
  2. https://mvnrepository.com/artifact/com.h2database/h2
Ajay Kumar
  • 4,864
  • 1
  • 41
  • 44
1

I had a similar exception (org.h2.jdbc.JdbcSQLSyntaxErrorException: Function "TO_TIMESTAMP" not found) when upgrading h2 from 1.4.2 to 2.2.202

I don't know why, but it appears that the function had been removed

To make it work, I replaced to_timestamp by parsedatetime

parsedatetime follow the java.text.SimpleDataFormat semantics


Edit : Another way would be to add compatibity mode to Oracle (Mode=Oracle):

Example in spring boot : https://stackoverflow.com/a/64799048/1546137

ihebiheb
  • 3,673
  • 3
  • 46
  • 55