| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Re: concatenating clob with string in SELECT
mikeg13_at_gmail.com wrote:
> I have dynamically created an INSERT statement that is populating a
> table with a CLOB field. The value being inserted into the CLOB field
> is generated by concatenating a bunch of strings. In some case, it
> exceeds the 4K limit for string concatenation. The concatenation will
> have the 4G limit of a CLOB, if one of the fields being concatenated is
> of a clob data type. How can I create a clob field to be used in the
> concatenation in the SELECT statement?
>
> For example,
>
> insert into table1 (field1, clobfield) SELECT field1, <4k
> string>||<4kstring> from table2;
>
> I would like to put a clob in the concatenation string to make this
> work. Something like ...
>
> insert into table1 (field1, clobfield) SELECT field1, <4k
> string>||<4kstring>||<clob literal> from table2;
There is no 4K limit for string concatenation.
A VARCHAR2 variable is 32K and there is nothing that stops you from concatenating multiple 32K VARCHAR2s into a CLOB.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Aug 03 2006 - 16:48:24 CDT
![]() |
![]() |