PL/SQL 在 Oracle 中插入具有长原始列的历史行
我的 Oracle 表中有一个很长的原始列。使用选择插入不起作用,因为长原始列也是我的选择语句的一部分。基本上我试图插入插入历史行并更改几个参数。因此我考虑在 Oracle 中使用 PL/SQL。我没有 PL/SQL 经验,谷歌搜索几天后也没有得到任何信息。任何人都可以帮我提供一个示例 PL/SQL 来解决我的问题吗?提前致谢 !!!
I have a long raw column in an Oracle table. Insert with select is not working because of the long raw column which is part of my select statement as well. Basically I am trying to insert to insert history row with couple of parameters changed. Hence I was thinking of using PL/SQL in Oracle. I have no experience in PL/SQL neither I got anything after googling for couple of days. Can anyone help me with a sample PL/ SQL for my problem ? Thanks in advance !!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LONG 和 LONG RAW 数据类型已被弃用,并且已经弃用很多年了。远离他们确实会更好。
话虽如此,如果您使用 PL/SQL,则数据大小将被限制为 32,760 字节,这是 LONG RAW PL/SQL 数据类型所能容纳的最大值。但是,LONG RAW 数据库数据类型最多可以容纳 2GB 的数据。因此,如果表中的任何行包含超过 32,760 字节的数据,您将无法使用 PL/SQL 检索它。这是 LONG 和 LONG RAW 数据类型的根本限制,也是 Oracle 不推荐使用它们的原因之一。
在这种情况下,唯一的选择是 Pro*C 或 OCI。
更多信息可以在这里找到:
http://download.oracle.com/docs /cd/B19306_01/appdev.102/b14261/datatypes.htm#CJAEGDEB
希望这有帮助。
LONG and LONG RAW datatypes are deprecated, and have been for many years now. You really are much better off getting away from them.
Having said that, if you're using PL/SQL, you will be limited to 32,760 bytes of data, which is the max that the LONG RAW PL/SQL datatype will hold. However, the LONG RAW database datatype, can hold up to 2GB of data. So, if any rows in your table contain data longer than 32,760 bytes, you will not be able to retrieve it using PL/SQL. This is a fundamental limitation of LONG and LONG RAW datatypes, and one of the reasons Oracle has deprecated their use.
In that case, the only options are Pro*C or OCI.
More information can be found here:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/datatypes.htm#CJAEGDEB
Hope that helps.
如果您的数据限制为 32kB,则可以直接在 PL/SQL 中使用 LONG RAW 列:
如果任何 LONG RAW 大于 32k,则此操作将会失败。
在这种情况下,您将不得不使用另一种语言。您可以使用java,因为它包含在数据库中。我已经用 LONG RAW 和 java 回答了几个关于 SO 的问题:
无论如何,正如您所注意到的,使用这种数据类型是很痛苦的。如果无法转换为 LOB,则必须使用解决方法。
You can work with a LONG RAW column directly in PL/SQL if your data is limited to 32kB:
This will fail if any LONG RAW is larger than 32k.
In that case you will have to use another language. You could use java since it is included in the DB. I already answered a couple of questions on SO with LONG RAW and java:
In any case as you have noticed it is a pain to work with this data type. If converting to LOB is not possible you will have to use a workaround.