加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Oracle中的长和长原始数据类型有什么区别?

发布时间:2020-12-12 16:25:56 所属栏目:百科 来源:网络整理
导读:我的理解是Long数据类型可以存储实际的字符串(chars),而Long原始数据类型存储字符串的二进制值(chars).这样对吗?表只能有一个长型列吗? 数据类型在文档中描述; LONG is explained here(或 11gR2 version): LONG columns store variable-length character
我的理解是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可能会引起关注.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读