a lot of people define varchar2 columns this way:
create table t1 ( a varchar2(1) );
… and expect that they will be able to insert one character into this column. well, this is not always true. the default for a varchar2 column is byte, so the above statement is equal to:
create table t1 ( a varchar2(1 byte) );
the data dictionary does reflect this if you know what the default is:
SQL> create table t1 ( a varchar2(1 char), b varchar2(1)); Table created. SQL> desc t1; Name Null? Type ----------------------------------------- -------- ---------------------------- A VARCHAR2(1 CHAR) B VARCHAR2(1) SQL>
so, if you work with multibyte character sets and do not take care of this, this may happen:
create table t1 ( a varchar2(1 char), b varchar2(1)); insert into t1 (a) values (chr(1000)); 1 row created. SQL> insert into t1 (b) values (chr(1000)); insert into t1 (b) values (chr(1000)) * ERROR at line 1: ORA-12899: value too large for column "SYS"."T1"."B" (actual: 2, maximum: 1)