On 2010-04-20 09:50:48 -0400, Martin Gainty wrote:
> some confusion on the oracle documentation
> 
> http://www.scribd.com/doc/21329014/Oracle10g-Develop-PLSQL-Program-Units-VOL2
> which states 
> CLOB Datatypes is for single byte character stream
> NCLOB is multibyte character stream based upon byte length of the supplied 
> database character set

I think this isn't quite correct. 

The distinction is that every Oracle database uses two character sets:
The "database character set" and the "national database character set".
The former is used for storing char, varchar2 and clob data, and also
for sql commands, stored procedures, etc. The latter is used for nchar,
nvarchar2 and nclob data. Because the "database character set" is also
used for parsing SQL, etc. it is more restricted: All the characters
which are used in SQL keywords must be single-byte, and I think (but I'm
not sure) they must also be US-ASCII on ASCII-based platforms. So UTF-8
can be used as a database character set, because in UTF-8 "SELECT" is 53
45 4c 45 43 54, same as in US-ASCII, but UTF-16 cannot, because in
UTF-16(-BE) "SELECT" is 00 53 00 45 00 4c 00 45 00 43 00 54, and the SQL
parser can't handle this. 

Before UTF-8 was supported, nvarchar and nclob (well, nlong actually,
nclob didn't yet exist) were important, because for many languages there
was no character set which was usable as a database character set *and*
included all characters needed for the language. These days you can just
use UTF-8 (AL32UTF8 in Oracle) and be done with it, although for some
languages and some applications it may still be useful to distinguish
between the two character sets.

        hp

-- 
   _  | Peter J. Holzer    | Auf jedem Computer sollte der Satz Ludwigs II
|_|_) | Sysadmin WSR       | eingeprägt stehen: "Ein ewig Rätsel will ich
| |   | h...@wsr.ac.at      | bleiben, mir und andern."
__/   | http://www.hjp.at/ |    -- Wolfram Heinrich in desd

Attachment: signature.asc
Description: Digital signature

Reply via email to