ORA-00997 Error Resolution: illegal use of LONG datatype

Source: Internet
Author: User
Tags commit oracle database

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.