Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Storage requirements of NCHAR columns
On 10 Jul 2006 06:42:24 -0700, "Ross" <rossfreemantle_at_yahoo.co.uk>
wrote:
>Hi.
>
>I have a question regarding the storage of NCHAR values. Suppose I'm
>using UTF8 as the national character set and I define a table as
>follows:
>
>CREATE TABLE table1 (column1 NCHAR(30));
>
>My question is, what exactly does the 30 mean? Is it 30 code units or
>30 characters?
>
>The Globaliztion Support Guide seems to suggests the former, which
>would imply that the column can store a maximum of 30 bytes. However,
>it then goes on to suggest that that the column has a maximum capacity
>of 90 bytes (30 3-byte characters).
>
>It seems to be contradicting itself. What am I missing?
>
>Thanks in advance.
>
Feel free to give version and platform next time.......
From the online doc (9i/10g) :
"NCHAR, NVARCHAR2, CLOB, and NCLOB columns are always character-based"
So the answer is that it can hold 30 chars, regardless what NCHARSET you are using.
With CHAR/VARCHAR datatypes you can vary between BYTE and and CHAR semantics through the NLS_LENGTH_SEMANTICS init-parameter. With a single-byte database charset, there is no difference between BYTE and CHAR.