> If you define CLASS VARCHAR2(2000 CHAR) then you can insert 4000 chars
> irrespective of their single- or multi- bytes.
Yep, when your NLS_LENGTH_SEMANTICS is set to CHAR (or you specify it at the
table column level) the behavior is same, but nevertheless the settings,
there are hard limits of 2000 BYTES for CHAR and 4000 BYTES for VARCHAR2.
You can't exceed those.
And beware the varchar2 case (tested on 10.2.0.1)
SQL> create table t(a varchar2(4000 char));
SQL> insert into t values(rpad('?',4000,'?'));
1 row created.
SQL> select length(a) from t;
The input is silently truncated!
Char case is better, it gives an error on overflow:
SQL> insert into t values(rpad('?',2000,'?'));
insert into t values(rpad('?',2000,'?'))
ERROR at line 1:ORA-12899
: value too large for column "SYS"."T"."A" (actual: 4000, maximum:
The index creation error was probably because the AL32UTF8 encoding was
used. With AL32UTF8, Oracle has to count for max 4 bytes per character, thus
couldn't allow creation of this index. If you either use UTF8 encoding (max
3 bytes per char) or just set NLS_LENGTH_SEMANTICS to BYTE before creating