Part 5 LONG type
LONG is a type of data that has been discarded, and the LOB type is its alternative. So we will discuss it after LOB.
We only need a simple understanding. Why does ORACLE retain this type, just for backward compatibility? In the new database design, do not use LONG columns.
There are two types of LONG:
LONG: 2 GB characters can be stored
Long raw: can store up to 2 GB of binary data.
We only need to understand the restrictions of the LONG type.
LONG/long raw type CLOB/BLOB type
A table can only have one LONG/long raw column. A table can have up to 1000 LOB columns.
It cannot be used for user-defined types. It can be used for user-defined types.
The LONG type cannot be referenced in the WHERE clause.
Except for not null, integrity constraints cannot be referenced
Distributed transactions are not supported.
You cannot use basic or advanced replication technology.
It cannot be used in group by, order by, connect by, DISTINCT, UNIQUE, INTERSECT, MINUS, or UNION to convert a scalar SQL type.
PL/SQL functions and procedures cannot be used as parameters
Cannot be applied to built-in functions, such as SUBSTR
The create table as select statement cannot use the LONG type.
Table spaces cannot be moved in tables of the LONG type.
In a word, the new system should no longer use the LONG type.
If some fields in some tables in the old system are of the LONG type, pay attention to its limitations.