Search notes:

ORA-01489: result of string concatenation is too long

The maximum length of a string that can created from string concatenation in (Oracle) SQL statements is 4000 characters if the value of max_string_size is STANDARD or 32767 if this value is EXTENDED.
If the length of the created string exceeds this limit, Oracle will throw an ORA-01489: result of string concatenation is too long error.
The following statement selects a concatenated string with exactly this amount of characters. Adding only one character will cause the error message (assuming the value of max_string_size is STANDARD):
select
   'This is a line with exactly one hundred characters                                                 |' ||
   'This is line  2                                                                                    |' ||
   'This is line  3                                                                                    |' ||
   'This is line  4                                                                                    |' ||
   'This is line  5                                                                                    |' ||
   'This is line  6                                                                                    |' ||
   'This is line  7                                                                                    |' ||
   'This is line  8                                                                                    |' ||
   'This is line  9                                                                                    |' ||
   'This is line 10                                                                                    |' ||
   'This is line 11                                                                                    |' ||
   'This is line 12                                                                                    |' ||
   'This is line 13                                                                                    |' ||
   'This is line 14                                                                                    |' ||
   'This is line 15                                                                                    |' ||
   'This is line 16                                                                                    |' ||
   'This is line 17                                                                                    |' ||
   'This is line 18                                                                                    |' ||
   'This is line 19                                                                                    |' ||
   'This is line 20                                                                                    |' ||
   'This is line 21                                                                                    |' ||
   'This is line 22                                                                                    |' ||
   'This is line 23                                                                                    |' ||
   'This is line 24                                                                                    |' ||
   'This is line 25                                                                                    |' ||
   'This is line 26                                                                                    |' ||
   'This is line 27                                                                                    |' ||
   'This is line 28                                                                                    |' ||
   'This is line 29                                                                                    |' ||
   'This is line 30                                                                                    |' ||
   'This is line 31                                                                                    |' ||
   'This is line 32                                                                                    |' ||
   'This is line 33                                                                                    |' ||
   'This is line 34                                                                                    |' ||
   'This is line 35                                                                                    |' ||
   'This is line 36                                                                                    |' ||
   'This is line 37                                                                                    |' ||
   'This is line 38                                                                                    |' ||
   'This is line 39                                                                                    |' ||
   'This is line 40                                                                                    |'
from
   dual;

See also

One notorious function that suffers from this error is the aggregate function LISTAGG. A replacement that uses data cartridge interface to create a user defined aggregate function as an alternative can be found here.
varchar2
ORA-01704: string literal too long
ORA-00910: specified length too long for its datatype
Other Oracle error messages

Index