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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Of CLOB's, multi-byte characters and NCLOB's...

Re: Of CLOB's, multi-byte characters and NCLOB's...

From: Djordje Jankovic <djordjej_at_rogers.com>
Date: Mon, 05 May 2003 21:46:35 -0800
Message-ID: <F001.0059080C.20030505214635@fatcity.com>


This is the extract from Oracle9i Database Globalization Support Guide, Release 2 (9.2), which is pretty much in line with what Dennis said:



A national character set is an alternate character set that enables you to store Unicode character data in a database that does not have a Unicode database
character set. Other reasons for choosing a national character set are:

     The properties of a different character encoding scheme may be more desirable for extensive character processing operations

     Programming in the national character set is easier

SQL NCHAR, NVARCHAR2, and NCLOB datatypes have been redefined to support Unicode data only. You can store the data in either UTF-8 or UTF-16 encodings.


>From the table in the same documentation, apparently in NCLOB (NVARCHAR2,
etc) one can store only Unicode multibyte characters, and not single-byte and multibyte non-Unicode.

So, as I understand it, if your database character set is NOT Unicode (i.e. UTF8) and you still want to store mutibyte characters in the database you can define type as NCLOB.

Djordje

> Here's a copy/paste from the Oracle docs on CLOB's and NCLOBS.
> ----------------------------------------------------------------
> CLOB Datatype
> The CLOB datatype stores single-byte character data. Both fixed-width and
variable-width character sets are supported, and both use the CHAR database character set. CLOBs can store up to 4 gigabytes of character data.
> ----------------------------------------------------------------
> NCLOB Datatype
> The NCLOB datatype stores multibyte national character set character
(NCHAR) data. Both fixed-width and variable-width character sets are supported. NCLOBs can store up to 4 gigabytes of character text data.
> ----------------------------------------------------------------
>
> The docs make it sound like CLOB's only store single-byte data and not
multi-byte data. On a UTF8 database we were able to store Japanese kanji in a column of type CLOB. In a browser the kanji displays as kanji according to our session NLS settings. (Pardon my apparent xenophobia but they just look like chicken scratchings to me ;-)
>
>
>
>
> -----Original Message-----
> Sent: Monday, May 05, 2003 3:52 PM
> To: Multiple recipients of list ORACLE-L
>
>
> Steve
> I don't understand this at all, but I happened to be reading on this,
and
> I think the difference is between the "Database Character Set" and the
> "National Character Set". CLOB works with the Database Character Set and
> NCLOB works with the National Character Set. If at database creation time
> you don't specify a National Character Set, it defaults to your Database
> Character Set. Someone earlier posted the following query on this list:
> select name, substr(value$,1,20) from sys.props$
> This displays all your NLS stuff for your database. Okay, we have now
> exceeded what I know about this subject, and hopefully someone on this
list
> that actually understands the multi-byte character sets will provide a
> further explanation.
>
> Dennis Williams
> DBA, 60%OCP, 100% DBA
> Lifetouch, Inc.
> dwilliams_at_lifetouch.com
>
>
> -----Original Message-----
> Sent: Monday, May 05, 2003 2:22 PM
> To: Multiple recipients of list ORACLE-L
>
>
> We have several columns of datatype CLOB and one of our developers says we
> can store multi-byte characters in Oracle CLOB columns because multi-byte
> characters are just a few single-byte characters strung together. Sure
> enough, using OCI our app displays multi-byte Kanji characters just fine.
> Interesting! So that being the case, what's the difference between CLOB's
> and NCLOB's? If CLOB's work just fine for storing multi-byte characters
then
> why even bother with NCLOB's? Even though our app has been working just
fine
> by storing multi-byte characters in CLOB's, are there any potential
gotchas?
>
>
> Still trying to get back into productive work after IOUG...
>
> Steve Orr
> Bozeman, Montana
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Orr, Steve
> INET: sorr_at_rightnow.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: DENNIS WILLIAMS
> INET: DWILLIAMS_at_LIFETOUCH.COM
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Orr, Steve
> INET: sorr_at_rightnow.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Djordje Jankovic
  INET: djordjej_at_rogers.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue May 06 2003 - 00:46:35 CDT

Original text of this message

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