Did You Know #1 – Unicode


So, this is the first “Did you know” post, and this time, unicode characters in char/varchar2 columns. Did you know that the hard limit for char is 2000 bytes and for varchar2 is 4000 bytes (can be extended to 32768 in 12c), regardless the characterset?

This means that even if you use “VARCHAR2(4000 CHAR)” in a column definition (which defines the column to have a maximum of 4000 characters and not 4000 bytes), the maximum is 4000 bytes. In AL32UTF8, characters can be up to 4 bytes, so in the worst case scenario you will be able to have only 1000 4-bytes character in this column.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s