The ora-00997:illegal use of a long datatype error occurred while converting the long type to the CLOB type in Oracle 10.2.0.4.
Finally, use the To_lob () function to resolve:
INSERT into T_clob SELECT A, To_lob (B) from T_long;
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Connecteatchd as Reporttest
Sql> CREATE TABLE T_long (A number, B LONG);
Table created
Sql> CREATE TABLE T_clob (A number, B CLOB);
Table created
Sql> INSERT into T_long VALUES (1, ' LONG DATA to CLOB ');
1 row inserted
Sql> commit;
Commit Complete
Sql> INSERT into T_clob SELECT A, B from T_long;
INSERT into T_clob SELECT A, B from T_long
Ora-00997:illegal Use of LONG datatype
Sql> INSERT into T_clob SELECT A and To_lob (B) from T_long;
1 row inserted
Sql> COMMIT;
Commit Complete
Sql> SELECT * from T_clob;
A B
---------- -------------------------------
1 LONG DATA to CLOB
This article is from the "Technical Knowledge exchange" blog, please be sure to keep this source http://xiahouyao123.blog.51cto.com/646312/1258225
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/