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: What's nchar, nvarchar, nclob ... for?

Re: What's nchar, nvarchar, nclob ... for?

From: Matthew Fuller <matthewlf_at_my-deja.com>
Date: Tue, 16 Jan 2001 18:55:52 GMT
Message-ID: <9425fi$4p9$1@nnrp1.deja.com>

In article <941ash$nlm$1_at_coco.singnet.com.sg>,   "Lee" <hengchee.lee_at_aretae.com> wrote:
> Hi,
> From the documentation provide by oracle, I 'guess' that every
 datatype
> start with a character has to do with national character set. I
 thought
> that if you gonna to store characters in non-English, for example,
 Chinese,
> Korean, etc., you'll need to use these type.
> But to my surprise, I manage to store Chinese text in a CLOB field.
 (I never
> tried NCLOB though), and when I create the database, I even just use
 the
> default which is US7ASCII for both Character Set and National
 Character Set.
> So my question is, what good is these type start with n for? And does
 your
> setting in National Character Set affect anything?
>
> Thanks and best regards
> Lee
>
>

Lee,

You should not be using the US7ASCII character set if you want to store characters that require more than 7 bits of precision (which all international character sets do).

It is true that you can store 8-bit data in a database created with US7ASCII, but perform this simple exercise to prove why this is bad: (1) export one of your tables that has international characters (decimal values above 127). (2) make a backup of the table (i.e. CREATE <backup_table> as SELECT * FROM <source_table>. (3) DROP the original table. (4) Import it from your EXPort file.

You'll notice in the imported version of your table that all characters above decimal 127 have now had 128 subtracted from them. This is because the 8th bit got stripped. (I've never done the research to find out if this is happening in the EXPort, the IMPort, or both). Suffice is to say when you use US7ASCII Oracle stores 8 bits of data because he doesn't want to go through the pain of storing only 7; however he figures you only care about the 7, so he doesn't really care what happens to that 8th bit at any point in time.

HTH. Matt.

Sent via Deja.com
http://www.deja.com/ Received on Tue Jan 16 2001 - 12:55:52 CST

Original text of this message

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