I am testing the repository class with insert query and facing issue:
ERROR:
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Function "SYSUTCDATETIME" not found; SQL statement:
insert into table name (cloumns1..x) values (?, ?, ?, SYSUTCDATETIME(), ?, ? , ?, SYSUTCDATETIME(),?); [90022-200]
VERSION:
I am using unit juniper version 5.8.x
Expectation Can someone please help
In h2 there is no SYSUTCDATETIME()
this function exists in SQL Server, for h2 you have to use CURRENT_TIMESTAMP
, for example:
INSERT INTO table_name (cloumns1, .., x)
values (?, ?, ?, CURRENT_TIMESTAMP, ?, ? , ?, CURRENT_TIMESTAMP, ?);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.