If you use UTF-8 encoding then one character can takes a various number of bytes (2 - 4). For PL/SQL the varchar2 limit is 32767 bytes, not characters. See how I increase a PL/SQL varchar2 variable of the 4000 character size:
SQL> set serveroutput on
SQL> l
1 declare
2 l_var varchar2(30000);
3 begin
4 l_var := rpad('A', 4000);
5 dbms_output.put_line(length(l_var));
6 l_var := l_var || rpad('B', 10000);
7 dbms_output.put_line(length(l_var));
8* end;
SQL> /
4000
14000
PL/SQL procedure successfully completed.
But you can't insert into your table the value of such variable:
SQL> ed
Wrote file afiedt.buf
1 create table ttt (
2 col1 varchar2(2000 char)
3* )
SQL> /
Table created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 l_var varchar2(30000);
3 begin
4 l_var := rpad('A', 4000);
5 dbms_output.put_line(length(l_var));
6 l_var := l_var || rpad('B', 10000);
7 dbms_output.put_line(length(l_var));
8 insert into ttt values (l_var);
9* end;
SQL> /
4000
14000
declare
*
ERROR at line 1:
ORA-01461: can bind a LONG value only for insert into a LONG column
ORA-06512: at line 8
As a solution, you can try to split this variable's value into several parts (SUBSTR) and store them separately.