oracle 甲骨文:LONG 还是 CLOB?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3599211/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 21:24:46  来源:igfitidea点击:

Oracle: LONG or CLOB?

databaseoracleclob

提问by Moeb

From these two threads,

从这两个线程,

LONG is archaic and deprecated. Oracle says,

LONG 已过时且已弃用。甲骨文说

Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility.

Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.

不要创建带有 LONG 列的表。请改用 LOB 列(CLOB、NCLOB)。支持 LONG 列只是为了向后兼容。

Oracle 还建议您将现有的 LONG 列转换为 LOB 列。LOB 列受到的限制比 LONG 列少得多。此外,LOB 功能在每个版本中都得到了增强,而 LONG 功能在几个版本中一直是静态的。

But you cannot read a CLOB from a remote database without the workarounds mentioned here.

但是,如果没有此处提到的变通方法,则无法从远程数据库读取 CLOB 。

Which one should I prefer to store some text in my tables?Or is there a better solution than these two?

我应该更喜欢哪一个在我的表格中存储一些文本?或者有比这两个更好的解决方案吗?

采纳答案by gpeche

Use CLOBs. One limitation of LONG is that LONGs can't be handled correctly from SQL - PL/SQL.

使用 CLOB。LONG 的一个限制是不能从 SQL - PL/SQL 正确处理 LONG。

For a more detailed description of the differences, see http://www.comp.dit.ie/btierney/oracle11gdoc/appdev.111/b28393/adlob_tables.htm#insertedID2

有关差异的更详细说明,请参阅http://www.comp.dit.ie/btierney/oracle11gdoc/appdev.111/b28393/adlob_tables.htm#insertedID2

回答by Rene

If Oracle says a feature is deprecated it may not be available any longer in a future release. So unless your application will run on the current Oracle version for an unlimited amount of time, don't use deprecated functionality.

如果 Oracle 说某个特性已被弃用,它在未来的版本中可能不再可用。因此,除非您的应用程序将在当前 Oracle 版本上无限运行,否则不要使用已弃用的功能。