Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01489 - Result of string concatenation is too long - Append big Varchar columns

2885d2eb-8b04-4ccb-a330-410b1c384e6aMay 12 2020 — edited May 13 2020

Hi All,

I'm trying to append 4 columns of data type such as varchar2(4000) || varchar2(4000) || varchar2(4000) || varchar2(100) and try to assign it to a CLOB datatype column of a table.

Something like below,

insert into test as select TO_CLOB (A || B || C  || D) as final from test_a;

Table-1: Test

A CLOB;

Table-2: Test_a

A varchar2(4000)

B varchar2(4000)

C varchar2(4000)

C varchar2(100)

I get the error as ORA-01489 Result of string concatenation is too long

I also tried doing separate CLOB conversion something like below, but it takes too long to execute.

insert into test as select TO_CLOB (A )  || TO_CLOB (B ) || TO_CLOB (C ) || TO_CLOB (D ) ) as final from test_a;

Please let me know if there is any other way of doing it.

P.S. I'm using Oracle 12c version

Comments
Post Details
Added on May 12 2020
8 comments
1,120 views