Oracle 中的 LONG 问题

发布于 2024-09-12 09:43:13 字数 257 浏览 8 评论 0原文

我有一个旧的 Oracle 数据库,其中有一个 LONG 类型的字段(最大大小为 2GB),

现在早些时候它曾经工作正常,但随着时间的推移,我们开始放入的数据大小远远超过 2GB,所以我们开始遇到麻烦。

我无法将字段类型从 LONG 更改为 CLOB,因为这会造成很多麻烦,因为必须对产品进行无数更改才能处理 CLOB 类型。

将数据分成块然后放入是一种选择,但我们该怎么做?

有人可以建议一种方法来处理这个问题。最好是代码或代码链接。

i have an old oracle database in which there is a field of type LONG(max size is 2GB)

Now earlier it used to work fine but with time data we started putting was of size much more than 2GB so we started facing trouble.

I can not change the field type from LONG to CLOB since that will create a lot of trouble as innumerable changes will have to be made to the product to deal with the CLOB type.

Dividing data into chunks and then putting is an option but how do we do that??

Can someone suggest a way to handle this . Preferably code or a link to the code.

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

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

发布评论

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

评论(1

黑寡妇 2024-09-19 09:43:13

问题是,在任何情况下都不能将超过 2GB 的数据传递给 LONG 变量。因此,您的应用程序有两个选择:

  • 在接触数据库之前将大数据分割成块,
  • 向数据库发送 CLOB 并让数据库处理它(例如使用视图和 INSTEAD OF 触发器)

哪种方法最适合您取决于详细信息您的申请。向我们提供更多信息,我们可以为您提供具体建议。

实际上还有第三种选择。 LONG 和 LONG RAW 数据类型已被弃用十多年了。也许是时候继续前进了……

The problem is, at no point can you pass more than 2GB to a LONG variable. So your application has two choices:

  • split the big data into chunks before touching the database
  • sending the database a CLOB and letting the database handle it (say with a view and an INSTEAD OF trigger)

Which approach will work best for you depends on the details of your application. Give us more info and we can give you specific advice.

Actually there is a third option. The LONG and LONG RAW data types have been deprecated for well over a decade. Perhaps it is time to move on ...

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