Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Storage requirements of NCHAR columns
On Tue, 11 Jul 2006 02:19:06 -0700, Ross wrote:
> The Oracle docs clearly suggest (in several places) that NCHAR columns
> are defined in terms of the number of code units. If this is true (and
> I suspect it isn't), an NCHAR(30) could only store 10 three-byte
> characters.
>
The Oracle docs clearly state that NCHAR is size in 'CHARACTERS', not bytes. In fact, they clearly state that the size in bytes may be several multiples of the size in charactes that are specified.
From the 10g R2 SQL Reference manual, in the area that provides detailed description of the data types and related sizes:
"
NCHAR[(size)]
Fixed-length character data of length size characters. The number of bytes
can be up to two times size for AL16UTF16 encoding and three times size
for UTF8 encoding. Maximum size is determined by the national character
set definition, with an upper limit of 2000 bytes. Default and minimum
size is 1 character.
"
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i45672
They also state that the limiting size is based on bytes of storage, not characters of storage. (This mixing of byte vs character can be confusing and irritating.)
-- Hans Forbrich (mailto: Fuzzy.GreyBeard_at_gmail.com) *** Feel free to correct me when I'm wrong! *** Top posting [replies] guarantees I won't respond.Received on Wed Jul 12 2006 - 13:21:23 CDT
![]() |
![]() |