Migrating from LONG to LOB
Starting from Oracle 10g, a LONG data is convertible to a LOB data in a table. This enhancement has enabled the migration of older data in LONG and LONG RAW columns to equivalent LOB
data types in Oracle. The data in the LONG type column is mapped to CLOB
or NCLOB
data types and the data in the LONG RAW type columns is mapped to the BLOB
data type. It can be achieved through the ALTER
TABLE
statement, where a LONG type column can be modified to the LOB type column:
ALTER TABLE [table name] MODIFY [LONG type column] [LOB type (CLOB | BLOB)];
During migration, the Oracle server implicitly takes care of the data conversion and movement from the LONG
to LOB
data type. A LONG
, LONG
RAW
, or VARCHAR2
type of data can be implicitly converted into CLOB
or BLOB
. Explicitly, the data can be converted using TO_CLOB()
and TO_BLOB()
converter functions. During migration, the nullity (NULL
or NOT
NULL
) and default value is also carried away to the new columns. Let us follow an...