From: markp7832@my-deja.com
Subject: Re: char vs varchar2
Date: 1999/12/23
Message-ID: <83tnkd$p9t$1@nnrp1.deja.com>#1/1
References: <83kcr6$8lj$1@nnrp1.deja.com> <83lcn9$tba$1@nnrp1.deja.com> <83leur$v0f$1@nnrp1.deja.com> <83re7n$70d$1@nnrp1.deja.com>
X-Http-Proxy: 1.0 x40.deja.com:80 (Squid/1.1.22) for client 199.228.142.8
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Thu Dec 23 17:55:13 1999 GMT
X-MyDeja-Info: XMYDJUIDmarkp7832
Newsgroups: comp.databases.oracle.server
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)


In article <83re7n$70d$1@nnrp1.deja.com>,
  amehta2000@my-deja.com wrote:
> Hi!
>
> How does Oracle handle Double-Byte Character
> Sets? For multilingual support, specifically for
> Double Byte Character Sets, can I still use CHAR
> to store a single character. The default size of
> CHAR is 1 byte..will this allow me to store
> special characters (such as Chinese letters) that
> require double-byte character sets?
>
> In article <83leur$v0f$1@nnrp1.deja.com>,
>   markp7832@my-deja.com wrote:
> > In article <83lcn9$tba$1@nnrp1.deja.com>,
> >   karsten_schmidt8891@my-deja.com wrote:
> > > Hi,
> > >
> > >  char is a fixed-length datatype.
> > >  if you have rows that need less than the max
 size you defined in the
> > > database, they will be right-padded with
 blanks.
> > >  Varchar2 is a true varying lenght type - no
 padding.
> > >
> > >  char is rarely used - in general you should
 use varchar2.
> > >
> > > Karsten
> > >
> > > In article <83kcr6$8lj$1@nnrp1.deja.com>,
> > >   marcus_chan@my-deja.com wrote:
> > > > hello,
> > > >
> > > > hope someone could enlighten me on these?
> > > > 1. What are the diffrences between
 Char/varchar2?
> > > > 2. When should i use char/varchar2 in table
 creation?
> > > >
> > > > thanks
> > > > marcus
> > > >
> > I agree use varchar2.  Look at Oracle's
 dictionary and Oracle
> > products.  They use varchar2 even for one byte
 columns.
> >
> > --
> > Mark D. Powell  -- The only advice that counts
 is the advice that
> >  you follow so follow your own advice --
>
I am not sure about double byte character sets, but I believe that the
datatypes char and varchar2 both still work as normal, but that you
have to account for the number of bytes instead of characters, that is,
a five character long char or varchar datatype would be declared as 10
bytes to hold the data.

The documentation for this should be in the Concepts manual chapter on
datatypes and in the Application Developers Guide.  Oracle provides
special datatypes NCHAR and NVARCHAR2 for working with multi-byte
character sets.

--
Mark D. Powell  -- The only advice that counts is the advice that
 you follow so follow your own advice --


Sent via Deja.com http://www.deja.com/
Before you buy.


