Apps DBA Concepts

Just another WordPress.com weblog

Long Data type

Posted by vasselva on March 25, 2010

Long data type is a most trouble data type to DBA’s. Instead of Long use CLOB or BLOB. If the table is created with Long datatype,use to_lob function to change to CLOB or BLOB

 a LONG into a CLOB 

 a LONG RAW into a BLOB

Pasting reply from the forum post

Once choice could be to export/import the table.
Now would be the time to consider converting it to BLOB:

SQL> create table t(col long raw) ;

Table created.

SQL> insert into t values (utl_raw.cast_to_raw('long')) ;

1 row created.

SQL> create table t2 as select to_lob(col) col from t ;

Table created.

SQL> desc t2
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ----
 COL                                                            BLOB

SQL> insert into t2 select to_lob(col) from t ;

1 row created.

SQL>

Leave a comment