gpt4 book ai didi

oracle - Oracle 中 long 和 long 原始数据类型有什么区别?

转载 作者:行者123 更新时间:2023-12-04 17:24:23 26 4
gpt4 key购买 nike

我的理解是 Long 数据类型可以存储实际的 string(chars),而 Long 原始数据类型存储 string(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.



所以一个 RAWLONG RAW可以包含字符的二进制表示,但不会受到字符集转换等的影响,所以可能不是那么有用; an 可以包含任何其他二进制数据 - 任何不应该代表文本的东西。

来自同一个 LONG部分:

A table can contain only one LONG column.



然而, LONG不赞成使用 LOB ( CLOBNCLOB 用于文本, BLOB 用于其他所有内容),因此您不应该将它们用于新工作,并且至少应该考虑替换您已经拥有的任何内容。再次来自 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 可能会感兴趣。

关于oracle - Oracle 中 long 和 long 原始数据类型有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12722636/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com