使用Spring Batch通过Progress解决最大长度或精度 [英] Solve max length or precision with Progress using Spring Batch

查看:185
本文介绍了使用Spring Batch通过Progress解决最大长度或精度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用spring batch,我需要从使用进度数据库的旧系统中查询数据.

但是我有这个异常java.sql.SQLException:[DataDirect] [OpenEdge JDBC驱动程序] [OpenEdge]表PUB中的Ag-Obs-conf列.议程的值超过了其最大长度或精度.

我可以在选择中使用SUBSTR来部分解决此问题,但是我需要数据库中的所有数据.

而且我无法以任何方式更改数据库.

任何人都可以给我一个解决方法的想法吗?

谢谢

解决方案

OpenEdge数据库将所有数据存储为可变长度.应用程序通常会超出声明的"SQL Width"属性,导致出现"Overstuff"字段.

使用dbtool的OpenEdge 11.6之前是调整SQL宽度的标准方法.快速,安全,有效:

http://knowledgebase.progress.com/articles/Article/P24496

从OpenEdge 11.6版开始,引入了新的数据库启动参数:

-SQLWidthUpdate打开

可以自动修复字符数据类型的SQL宽度.

有关此新功能的更多信息,请参见:

https://community.progress.com/community_groups/openedge_rdbms /f/18/t/19534

11.6及更高版本中还有一些选项可以自动截断返回的数据(如果您愿意的话):

http://knowledgebase.progress.com/articles/Article/How-to-enable-Authorized-Data-Truncation-in-a-JDBC-or-ODBC-connection/p

I'm using spring batch, and I need to query data from a legacy system, which uses the progress database.

However I am with this exception java.sql.SQLException: [DataDirect][OpenEdge JDBC Driver][OpenEdge] Column Ag-Obs-conf in table PUB.Agenda has value exceeding its max length or precision.

I was able to partially solve this problem using a SUBSTR in the select, but I need all the data from the database.

And I can not in any way change the database.

Can anyone give me an idea how to solve this?

Thank you

解决方案

The OpenEdge database stores all data as variable length. Applications very commonly "overstuff" fields beyond the declared "SQL Width" attribute which is what is causing the error that you see.

Prior to OpenEdge 11.6 using dbtool is the standard way to adjust SQL width. It is fast, safe and effective:

http://knowledgebase.progress.com/articles/Article/P24496

Starting from OpenEdge version 11.6 a new database startup parameter was introduced:

-SQLWidthUpdate ON

that can automatically fix the SQL width of character datatypes.

More information about this new feature can be found here:

https://community.progress.com/community_groups/openedge_rdbms/f/18/t/19534

There are also some options in 11.6+ to automatically truncate returned data if that is what you prefer:

http://knowledgebase.progress.com/articles/Article/How-to-enable-Authorized-Data-Truncation-in-a-JDBC-or-ODBC-connection/p

这篇关于使用Spring Batch通过Progress解决最大长度或精度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆