Difference between VARCHAR2(xx CHAR) and NVARCHAR2(xx)

From: Álvaro G. Vicario <alvaro.NOSPAMTHANX_at_demogracia.com.invalid>
Date: Wed, 22 Dec 2010 12:54:56 +0100
Message-ID: <iesouh$cks$1_at_news.eternal-september.org>



I've just installed Oracle XE (Oracle Database 10g Express Edition Universal). I've changed nothing so it's the using the character sets specified in the default settings:

     SELECT * FROM NLS_DATABASE_PARAMETERS;

     NLS_CHARACTERSET       AL32UTF8
     NLS_NCHAR_CHARACTERSET AL16UTF16

Given that both CHAR and NCHAR data types seem to accept multi-byte strings (UTF-8 and UTF-16), what is the exact difference between these two column definitions?

     VARCHAR2(10 CHAR)
     NVARCHAR2(10)

I've found similar questions in many forums but they always explain CHAR vs VARCHAR or mention that NVARCHAR2 accepts multi-byte strings.

My educated guess is VARCHAR2 is a legacy type that did not accept multi-byte, NVARCHAR2 was added, then VARCHAR2 was enhanced to support multi-byte... And also VARCHAR2 depends on the server version to be able to store multi-byte while NVARCHAR2 is always available.

Am I right?

--

Received on Wed Dec 22 2010 - 05:54:56 CST

Original text of this message