Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Storage requirements of NCHAR columns

Re: Storage requirements of NCHAR columns

From: Andreas Piesk <a.piesk_at_gmx.net>
Date: 10 Jul 2006 16:21:41 -0700
Message-ID: <1152573701.439892.253850@m73g2000cwd.googlegroups.com>

Kenneth wrote:
> On 10 Jul 2006 09:59:49 -0700, "Ross" <rossfreemantle_at_yahoo.co.uk>
> wrote:
>
> >
> >"When you use NCHAR and NVARCHAR2 datatypes for storing multilingual
> >data, the
> >column size specified for a column is defined in number of characters.
> >(The number of
> >characters means the number of Unicode code units.)"
> >
> >This sould seem to suggest that the a NCHAR(30) column would actually
> >require 30 bytes of storage (as UTF8 has a single-byte code unit).
> >However, an example in Chapter 7 explicitly states that 90 bytes are
> >required. I don't think the NLS_LENGTH_SEMANTICS parameter affects
> >NCHAR, so which is correct?
> >
>
> UTF8 is not a single-byte charset. It is a varying-width charset.

he didn't say UTF8 is single-byte. he said UTF8 uses 8bit code units which is, according to unicode.org, true.

> If you defines a NCHAR(30) column, it will contain 30 characters
> (unless NULL). Always. Period.

if the statement "The number of characters means the number of Unicode code units." is true, than his assumption is correct because for UTF8 the number of characters == number of 8bit code units == number of bytes.

i _think_ you're right, but Ross too. maybe the documentation is wrong or at least misleading.

regards,
-ap Received on Mon Jul 10 2006 - 18:21:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US