如何处理(cx_oracle.databaseerror)dpi-1037:数组位置以错误1406获取的列?

发布于 2025-01-30 02:16:15 字数 730 浏览 1 评论 0 原文

我正在使用 python,pandas,sqlalchemy和cx_oracle 在Oracle DB中执行选择查询。

但是我无法从具有较长类型的列中检索数据。当我从查询中删除它时,它运行良好,但是当其中包含时,我会得到”(cx_oracle.databaseerror)dpi-1037:rarray位置处的列(*)用错误1406“

我ran ran ran在这篇文章中如何求解错误:ora----- 01406提取的列值被截断了吗?,并阅读官方文档 这个问题似乎与列缓冲区的大小有关,但我不知道如何使用Pandas或其他Python库克服它。

无论如何我能处理这个错误吗?

先感谢您

I am using Python, pandas, sqlalchemy and cx_Oracle to execute a select query in an Oracle DB.

But I am not able to retrieve data from a column that has type LONG. When I remove it from the query, it runs fine, but when it is included I get "(cx_Oracle.DatabaseError) DPI-1037: column at array position (*) fetched with error 1406"

I ran into this post How to solve error: ORA-01406 fetched column value was truncated?, and read the official documentation http://www.dba-oracle.com/t_ora_01406_fetched_column_value_was_truncated.htm
The problem seems to be related to the size of the column buffer but I don't know how I would overcome it using pandas or another python library.

Is there anyway I can deal with this error?

Thank you in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄兵必败 2025-02-06 02:16:15

对于任何偶然发现的人,我最终通过cx_oracle执行查询,然后将结果加载到pandas之后

For anyone who stumbles upon this, I ended up executing the query via cx_Oracle and loading the result with pandas afterwards

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文