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: Ross <rossfreemantle_at_yahoo.co.uk>
Date: 11 Jul 2006 06:36:58 -0700
Message-ID: <1152625018.587153.144780@s13g2000cwa.googlegroups.com>


> > > UTF8 would require between 1 to 3 bytes. surrogate pairs would use 6
> > > bytes in UTF8.
> > > AL32UTF8 which is the "real" UTF8 would use between 1 to 4 bytes.
> > >
> > > When a nchar column of length N is defined (in al16UTF16). The maximum
> > > bytes you can
> > > enter in that column is 2 * N.
> > > If NCHAR is of UTF8 type, then maximum bytes you can enter in that
> > > column
> > > is 3 * N.
> > >
> > > The hard limit of 4000 bytes still applies. So a 4000 CHAR column does
> > > not necessarily
> > > mean it will hold 4000 characters (in utf8 or al16utf16).
> > >
> > > Metalink Note: 144808.1 provides some info on this ...
> > >
> > > Anurag
> >
> > This would seem to tally with what is suggested in the docs. If it's
> > correct, then an NCHAR(30) column could only contain 30 characters if
> > they were all single-byte. This, however, contradicts the earlier posts
> > that suggest it could contain 30 characters regardless of their
> > individual encoding.
>
> ? Are you interpreting it differently? nchar(30) WOULD contain 30
> characters
> even if they were multibyte. The actual byte length is adjusted to
> ensure that.
>
> Anurag

Sorry, I misinterpreted your post. If what you say is correct, what do you make of the suggestion in the Oracle docs that NCHAR columns are defined in terms of code units? Is it incorrect, or have I missed something? Received on Tue Jul 11 2006 - 08:36:58 CDT

Original text of this message

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