我正在使用mybatis库来执行本机sql查询。 我正在使用jooq为不同的方言生成动态sql查询。
语法:
condition = condition.and(DSL.field("START_TIME_").between("2014-10-12")
.and("2014-10-12"));
Error:
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SELECT * FROM ACT_HI_PROCINST WHERE (DELETE_REASON_ IS NULL AND START_TIME_ BETWEEN CAST(:[*]1 AS VARCHAR) AND CAST(:2 AS VARCHAR))
LIMIT ? OFFSET ? "; expected "NOT, EXISTS, INTERSECTS, SELECT, FROM"; SQL statement:
select *
from ACT_HI_PROCINST
where (DELETE_REASON_ is null and START_TIME_ between cast(:1 as varchar) and cast(:2 as varchar))