How to interpret ALL_TAB_COLS.DATA_LENGTH = 4000 for Oracle's CLOB types?

感情迁移 提交于 2019-12-11 10:28:37

问题


When I create a table with a CLOB in it, the CLOB column is reported to have a DATA_LENGTH of 4000:

create table test (
  data clob
);

-- Returns 4000
select data_length from all_tab_cols
where table_name = 'TEST';

How can I interpret that? Is that some backwards-compatible tweak, considering that the limit for VARCHAR2 is also 4000? Or is this to indicate that I can only insert / update string literals of length 4000? Is this behaviour of SYS.ALL_TAB_COLS documented somewhere?


回答1:


Up to 4000 bytes can be stored in-line in the tablespace. If the length of the CLOB exceeds 4000 bytes it must be stored in/readed from LOB storage area via special functions.

See also:

  • http://www.dba-oracle.com/t_blob.htm
  • http://www.dba-oracle.com/t_table_blob_lob_storage.htm


来源:https://stackoverflow.com/questions/10137992/how-to-interpret-all-tab-cols-data-length-4000-for-oracles-clob-types

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