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: Unicode Character Allocation

Re: Unicode Character Allocation

From: Brian Peasland <oracle_dba_at_nospam.peasland.net>
Date: Thu, 13 Apr 2006 21:14:34 GMT
Message-ID: <IxoJ0C.JI3@igsrsparc2.er.usgs.gov>


> To confirm, if the database is set to UTF-8 and I were to create a
> field varchar2(100 BYTES) the max it could be is 100 bytes? Oracle will
> not interpret this as "100 UTF-8 bytes" (which would be 400)?

Oracle will interpret VARCHAR2(100 BYTES) as 100 *bytes* of storage...no more bytes than that will be allowed.

As you know, multibyte charactersets can require between 1 and 4 bytes of storage per character, depending on that character. So if you want to store 100 UTF-8 characters, then define the column as VARCHAR2(100 CHAR). BYTES means max bytes.....CHAR means max characters.

The BYTES and CHAR designations came out in Oracle 9i. Personally, I've never seen a need to specify BYTES. When I create my VARCHAR2 column, I denote the max number of characters the column can hold, no many how many bytes that may be.

HTH,
Brian

-- 
===================================================================

Brian Peasland
oracle_dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Thu Apr 13 2006 - 16:14:34 CDT

Original text of this message

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