问题
I am using H2 database for integration test. The code is quiet old and is using JDBC queries instead.
While running tests i am getting the error below
org.h2.jdbc.JdbcSQLException: Function "TO_CHAR" not found; SQL statement:
I can see that H2 does not implecitely supports TO_CHAR function. Is there any way to add a custom methor or should i think about moving to HSQL DB or any other database for testing purpose.
回答1:
Use the newer version 1.3.175. Since 2014-01-18 available with a TO_CHAR function.
回答2:
You could try HSQLDB of course. I think it does support TO_CHAR.
Or you could write a user defined function in H2.
来源:https://stackoverflow.com/questions/17832394/to-char-function-not-available-in-h2-database