liquibase.exception.databaseexception:org.h2.dbc.jdbcbatchupdateexception:不能解析“日期”常数&quot dateadd(day,-2,curdate())
升级到Liquibase 3.9.0和H2 1.4.200之后,当尝试从CSV文件加载数据时,我会收到此错误消息。原因:liquibase.exception.databaseexception:org.h2.dbc.jdbcbatchupdateexception:不能解析“ date” date“ constand” dateadd(day,-2,curdate(curdate())”;它工作的最后版本是Liquibase 3.5.5和H2 1.4.197。
Bellow是CSV结构结构的一个示例:
ID; sender; client_code; status; title; streamfile_name; dovely_channel; tovelion_time; tovely_address; viewed_time; viewed_time; viseible_until; viseible_until; document_date ; client; test; user_interaction; test_document1; estdocument_1; null; null; null; null; null; null; null; dateadd(day,-2,curdate());
pom pom shise this:
<liquibase.version>3.9.0</liquibase.version>
<liquibase-hibernate5.version>3.8</liquibase-hibernate5.version>
<h2.version>1.4.200</h2.version>
<validation-api.version>2.0.1.Final</validation-api.version>
liquibase脚本:如果我是我是没有指定我收到上述错误的字段类型,如果我这样指定
列名=“ document_date” type =“ date
,然后我会收到一个错误,即该字段不能为null,因为不允许那里null值,并且由于无法解析liquibase fut null。
after upgrading to liquibase 3.9.0 and h2 1.4.200, I'm receiving this error message when trying to load data from a csv file. Reason: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcBatchUpdateException: Cannot parse "DATE" constant "DATEADD(DAY,-2,CURDATE())"; Last versions it worked were liquibase 3.5.5 and h2 1.4.197.
Bellow is an example of how the csv is structured :
id;sender;client_code;status;title;streamfile_name;delivery_channel;delivery_time;delivery_address;viewed_time;visible_until;document_date;
Client;Test;USER_INTERACTION;test_document1;ESTDOCUMENT_1;null;null;null;null;null;DATEADD(DAY,-2,CURDATE());
POM looks like this:
<liquibase.version>3.9.0</liquibase.version>
<liquibase-hibernate5.version>3.8</liquibase-hibernate5.version>
<h2.version>1.4.200</h2.version>
<validation-api.version>2.0.1.Final</validation-api.version>
liquibase script:If I am not specifying the type of the field I receive the error mentioned above, if I specify it like this
column name="document_date" type="date
Then I am receiving an error that the field cannot be null, as null values are not allowed there and because it cannot be parsed liquibase puts null.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
H2没有
currdate()
。您应该使用 current_date 而不是。H2 doesn't have
currdate()
. You should use current_date instead.