Oracle: LONG or CLOB?

岁酱吖の 提交于 2019-11-28 07:16:35

问题


From these two threads,

  • Why is LONG an issue with Oracle?
  • Is it possible to read a CLOB from a remote Oracle database?

LONG is archaic and deprecated. Oracle says,

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.

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

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


回答1:


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

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




回答2:


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.



来源:https://stackoverflow.com/questions/3599211/oracle-long-or-clob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!