Home » SQL & PL/SQL » SQL & PL/SQL » SQL-Developer and string more than 4000 char
SQL-Developer and string more than 4000 char [message #512592] |
Tue, 21 June 2011 02:06  |
 |
Anishkrithik
Messages: 23 Registered: June 2011 Location: TN
|
Junior Member |
|
|
Hi,
If i try to find length of the string with more than 4000 char in SQL Developer it throws error "ORA-01704: string literal too long". Please suggest me if anything i need to SET in preference.
select length('string with more than 4000 char) from dual;
[EDITED by LF: fixed [code] tags]
[Updated on: Tue, 21 June 2011 03:03] by Moderator Report message to a moderator
|
|
|
|
Re: SQL-Developer and string more than 4000 char [message #512692 is a reply to message #512596] |
Tue, 21 June 2011 09:16   |
Solomon Yakobson
Messages: 3305 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
It has nothing to do which tool you are using. Oracle VARCHAR2 strings (including literals) are limited to 4000 bytes. You need to split literal into up to 4000 byte chunks, convert to clob and concatenate:
SQL> select length(lpad('A',3000,'A') || lpad('A',3000,'A')) from dual;
select length(lpad('A',3000,'A') || lpad('A',3000,'A')) from dual
*
ERROR at line 1:
ORA-01489: result of string concatenation is too long
SQL> select length(to_clob(lpad('A',3000,'A')) || lpad('A',3000,'A')) from dual;
LENGTH(TO_CLOB(LPAD('A',3000,'A'))||LPAD('A',3000,'A'))
-------------------------------------------------------
6000
SQL>
SY.
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Jun 03 11:19:15 CDT 2025
|