Sunday, August 31, 2008

Considerations about Multibyte Charactersets

Lets see an example of MultiByte character set,
SQL> create table t_1 (col1 varchar2(1));
Table created.

SQL> create table t_2 (col1 varchar2(1 CHAR));
Table created.

SQL> insert into t_1 values ('é');
insert into t_1 values ('é')
*
ERROR at line 1:
ORA-12899: value too large for column "MY_UTF"."T_1"."COL1" (actual: 3,maximum: 1)

SQL> insert into t_2 values ('é');
1 row created.

The important thing is that, the character 'é' is not a single byte character. Thats why, it could be stored in a column that is with a fixed char length not a fixed byte length.

No comments:

search engine

Custom Search