我的理解是Long数据类型可以存储实际的字符串(chars),而Long原始数据类型存储字符串的二进制值(chars).这样对吗?表只能有一个长型列吗?
数据类型在文档中描述;
LONG is explained here(或
11gR2 version):
LONG columns store variable-length character strings containing up to 2 gigabytes -1,or 231-1 bytes. LONG columns have many of the characteristics of VARCHAR2 columns. You can use LONG columns to store long text strings.
LONG RAW is here:
The RAW and LONG RAW datatypes store data that is not to be interpreted (that is,not explicitly converted when moving data between different systems) by Oracle Database. These datatypes are intended for binary data or byte strings. For example,you can use LONG RAW to store graphics,sound,documents,or arrays of binary data,for which the interpretation is dependent on the use.
因此RAW或LONG RAW可以包含字符的二进制表示,但不会受到字符集转换等的影响,因此可能不是那么有用;一个可以包含任何其他二进制数据 – 任何不应该代表文本的东西.
来自同一个LONG部分:
A table can contain only one LONG column.
但是,LONG不赞成使用LOB(CLOB或NCLOB用于文本,BLOB用于其他所有内容),因此您不应该将它们用于新工作,并且至少应该考虑更换已有的LOB.同样来自LONG的同一部分:
Do not create tables with LONG columns. Use LOB columns (CLOB,NCLOB, BLOB) instead. LONG columns are supported only for backward compatibility.
Oracle also recommends that you convert existing LONG columns to LOB columns.
这documentation on migrating from LONG to LOB 可能会引起关注. (编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|